Skip to content

Commit

Permalink
Merge pull request #21 from laurobmb/logstash
Browse files Browse the repository at this point in the history
Logstash's config for janusec log
  • Loading branch information
janusec2 authored May 25, 2023
2 parents 2e0c9ba + 4e1ea6b commit 111f694
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions logstash/janusec.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
input {
file {
path => "/usr/local/janusec/log/*.log"
start_position => "beginning"
sincedb_path => "/dev/null"
}

file {
path => "/usr/local/janusec/log/*.log"
start_position => "beginning"
sincedb_path => "/dev/null"
}

}

filter {
grok {
match => { "message" => "%{SYSLOGPROG:date} %{TIME:time} \[%{GREEDYDATA:IP}\] %{WORD:method} \[%{GREEDYDATA:path}\] UA:%{GREEDYDATA:navegador}" }

}
date {
match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
}
geoip {
source => ["IP"]
target => "geoip"
fields => ["continent_code", "longitude", "city_name", "region_code", "country_name", "location", "ip", "latitude"]
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
}
mutate {
convert => [ "[geoip][coordinates]", "float" ]
}
}

output {
elasticsearch {
hosts => ["ELASTIC_SRV:9200"]
user => "elastic"
password => "changeme"
manage_template => false
index => "janusec-%{+YYYY.MM.dd}"
}
stdout { codec => rubydebug }
}


0 comments on commit 111f694

Please sign in to comment.