I want to print some events from log file before upload to elasticsearch on stdout console but I don't know why don't work this conf file for me.
input{
file{
type => "log"
codec => "json"
path => "/var/log/test.log"
start_position => "beginning"
sincedb_path => "/var/test/sincedb/.sincedb_log"
}
filter {
grok {
match => ["message", "%{SYSLOGBASE} %{URIPATH:url}%{GREEDYDATA:datagreedy}"]
}
if "http://google.com" == [url]{
metrics{
meter => "google_events"
add_tag => "google"
}
}
}
output{
if "google" in [tags]{
stdout {
codec => line { format => "count: %{[google_events][count]} - %[message]"
}
}
elasticsearch {
index => "test"
hosts => ["http://localhost:9200"]
}
}