Skip to content

Instantly share code, notes, and snippets.

@joejulian
Forked from louiszuckerman/gist:1499710
Last active December 19, 2015 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joejulian/5982126 to your computer and use it in GitHub Desktop.
Save joejulian/5982126 to your computer and use it in GitHub Desktop.
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"
}
mutate {
replace => [ "timestamp", "%{timestamp}+0000" ]
type => "glusterfs"
}
mutate {
replace => [ "timestamp", "%{timestamp}+0000" ]
type => "glusterfsbrick"
}
date {
timestamp => "yyyy-MM-dd HH:mm:ss.SSSSSSZ"
type => "glusterfs"
}
date {
timestamp => "yyyy-MM-dd HH:mm:ss.SSSSSSZ"
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