Skip to content

Instantly share code, notes, and snippets.

@monogot
Created September 3, 2019 10:34
Show Gist options
  • Save monogot/97dea3de2ba155b728ccf762ab9aec8b to your computer and use it in GitHub Desktop.
Save monogot/97dea3de2ba155b728ccf762ab9aec8b to your computer and use it in GitHub Desktop.
input {
tcp {
port => 5000
}
}
filter {
grok {
match => {
"message" => "%{SYSLOG5424PRI:pri}%{NUMBER:rfc_version} %{TIMESTAMP_ISO8601:timestamp} d.%{UUID:drain_id} %{WORD:app} %{USERNAME:dyno} - - %{GREEDYDATA:message}"
}
overwrite => ["message"]
remove_field => ["pri", "rfc_version", "dyno", "timestamp", "syslog5424_pri"]
}
if [drain_id] == "380ffb06-081d-431b-8ccd-c2571e70c49b" {
mutate {
add_field => { "data_source" => "noticen_staging" }
}
}
if [message] =~"^\{.*\}[\s\S]*$" {
json {
source => "message"
}
mutate {
add_tag => ["json"]
}
}
}
output {
elasticsearch {
hosts => "elasticsearch:9200"
user => "elastic"
password => "changeme"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment