Skip to content

Instantly share code, notes, and snippets.

@hamiltont
Last active August 29, 2015 14:06
Show Gist options
  • Save hamiltont/0bfc70ca5f4996dd773a to your computer and use it in GitHub Desktop.
Save hamiltont/0bfc70ca5f4996dd773a to your computer and use it in GitHub Desktop.
input {
file {
type => "couchpotato"
path => [ "/logs/couchpotato/CouchPotato.log" ]
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
# Get rid of any color codes
# NOT WORKING
#mutate {
# gsub => [ "message", "\\e\[0m", ""]
#}
grok {
match => [ "message", "%{MONTHNUM}-%{MONTHDAY} %{TIME} %{LOGLEVEL} \\e\[0m\[%{DATA:module}\] %{GREEDYDATA:couch_message}\\e\[0m" ]
}
}
output {
stdout { codec => rubydebug }
}
@untergeek
Copy link

Full config (updated to catch space or not):

input { stdin {} }

filter {
  # Get rid of any color codes
  mutate {
    gsub => [ "message", "\\e\[0m", ""]
  }
  grok {
    pattern => [ "%{MONTHNUM}-%{MONTHDAY} %{TIME} %{LOGLEVEL} \[(?:%{SPACE})%{NOTSPACE:module}\] %{GREEDYDATA:couch_message}" ]
  }
}

output { stdout { codec => rubydebug } }

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