Skip to content

Instantly share code, notes, and snippets.

@fetep
Created January 8, 2012 00:21
Show Gist options
  • Save fetep/1576586 to your computer and use it in GitHub Desktop.
Save fetep/1576586 to your computer and use it in GitHub Desktop.
logstash event modifiers
input {
stdin {
type => "test"
}
}
filter {
mutate {
add_field => [
"regexp_test", "%{@message:s/foo/bar}",
"regexp_test_g", "%{@message:s/foo/bar/g}",
"tr_test", "%{@message:tr/./_/}"
]
}
}
output {
stdout {
debug => true
}
}
{
"@source" => "stdin://carrera.databits.net/",
"@type" => "test",
"@tags" => [],
"@fields" => {
"regexp_test" => [
[0] "bar.foo.foo"
],
"regexp_test_g" => [
[0] "bar.bar.bar"
],
"tr_test" => [
[0] "foo_foo_foo"
]
},
"@timestamp" => "2012-01-08T00:20:24.450000Z",
"@source_host" => "carrera.databits.net",
"@source_path" => "/",
"@message" => "foo.foo.foo"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment