Skip to content

Instantly share code, notes, and snippets.

@louiszuckerman
Created December 20, 2011 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save louiszuckerman/1499710 to your computer and use it in GitHub Desktop.
Save louiszuckerman/1499710 to your computer and use it in GitHub Desktop.
logstash parser for glusterfs logs
input {
file {
path => "/var/log/glusterfs/*.log"
sincedb_path => "/var/tmp/.glusterfs.sincedb"
format => "plain"
type => "glusterfs"
}
file {
path => "/var/log/glusterfs/bricks/*.log"
sincedb_path => "/var/tmp/.glusterfs.bricks.sincedb"
format => "plain"
type => "glusterfsbrick"
}
}
filter {
grok {
pattern => "%{GLUSTERLOG}"
patterns_dir => "/opt/logstash/patterns"
type => "glusterfs"
}
grok {
pattern => "%{GLUSTERLOG}"
patterns_dir => "/opt/logstash/patterns"
type => "glusterfsbrick"
}
grep {
match => [ "timestamp", ".*" ]
type => "glusterfs"
}
grep {
match => [ "timestamp", ".*" ]
type => "glusterfsbrick"
}
date {
timestamp => "yyyy-MM-dd HH:mm:ss.SSSSSS"
type => "glusterfs"
}
date {
timestamp => "yyyy-MM-dd HH:mm:ss.SSSSSS"
type => "glusterfsbrick"
}
}
output {
-- your outputs --
}
===========
/opt/logstash/patterns/glusterfs:
GLUSTERTIMESTAMP %{DATE} %{TIME}
GLUSTERCODEPART %{NOTSPACE:codefile}:%{INT:codeline}:%{NOTSPACE:codefunc}
GLUSTERLOG \[%{GLUSTERTIMESTAMP:timestamp}\] %{NOTSPACE:level} \[%{GLUSTERCODEPART}\] %{NOTSPACE:subvolume}: %{GREEDYDATA:message}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment