Skip to content

Instantly share code, notes, and snippets.

@fetep
Created March 6, 2012 14:45
Show Gist options
  • Save fetep/1986634 to your computer and use it in GitHub Desktop.
Save fetep/1986634 to your computer and use it in GitHub Desktop.
sample logstash config for rails log line
input {
stdin {
type => rails
}
}
filter {
grok {
type => "rails"
pattern => "Completed %{GREEDYDATA:operation} in %{NUMBER:time:int}ms"
}
}
output {
stdout {
debug => true
}
}
Completed foo bar in 54ms
{
"@source" => "stdin://carrera.databits.net/",
"@type" => "rails",
"@tags" => [],
"@fields" => {
"operation" => [
[0] "foo bar"
],
"time" => [
[0] 54
]
},
"@timestamp" => "2012-03-06T14:43:56.764000Z",
"@source_host" => "carrera.databits.net",
"@source_path" => "/",
"@message" => "Completed foo bar in 54ms"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment