Skip to content

Instantly share code, notes, and snippets.

@lusis
Created October 25, 2011 14:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lusis/1312919 to your computer and use it in GitHub Desktop.
Save lusis/1312919 to your computer and use it in GitHub Desktop.
logstash gelf input test

Grab the jar

http://semicomplete.com/files/logstash/logstash-1.1.0beta6-monolithic.jar

start the sender

java -jar logstash-1.1.0beta6-monolithic.jar agent -c logstash-sender.conf

start the receiver

java -jar logstash-1.1.0beta6-monolithic.jar agent -c logstash-receiver.conf

In sender terminal

[] me@~/Downloads$ java -jar logstash-1.1.0beta6-monolithic.jar agent -c logstash-1.conf 
test input
{
         "@source" => "stdin://jvincent-MacBookPro/",
           "@type" => "test_input",
           "@tags" => [],
         "@fields" => {},
      "@timestamp" => "2011-10-25T14:22:49.196000Z",
    "@source_host" => "jvincent-MacBookPro",
    "@source_path" => "/",
        "@message" => "test input"
}

In receiver terminal

[] me@~/Downloads$ java -jar logstash-1.1.0beta6-monolithic.jar agent -c logstash-2.conf 
{
         "@source" => "gelf://jvincent-MacBookPro/",
           "@type" => "gelf-test",
           "@tags" => [],
         "@fields" => {
              "version" => "1.0",
                 "host" => "jvincent-MacBookPro",
                "level" => nil,
             "facility" => "logstash-gelf",
        "short_message" => "test input",
         "full_message" => "test input",
                 "file" => "/",
            "timestamp" => 1319552569.294,
                 "line" => 105
    },
      "@timestamp" => "2011-10-25T14:22:49.000000Z",
    "@source_host" => "jvincent-MacBookPro",
    "@source_path" => "/",
        "@message" => "test input"
}
input {
gelf { debug => true type => "gelf-test" }
}
output {
stdout { debug => true }
}
input {
stdin { type => 'test_input' }
}
output {
gelf { host => '127.0.0.1' }
stdout { debug => true }
}
@JulienBlancher
Copy link

Thanks for that !
Currently debug is going to be removed from logstash, for gelf you can use "level" instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment