Created
February 10, 2018 18:55
-
-
Save nhnmomonga/97ebc5b2d632493456a042192a447573 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
file { | |
path => "<抽出したログへのパス>" | |
type => "miraivariant" | |
start_position => "beginning" | |
} | |
} | |
filter { | |
csv { | |
columns => ["timestamp","source_ip","source_port","dist_port"] | |
separator => " " | |
convert => { | |
"timestamp" => "date" | |
} | |
} | |
date { | |
match => ["timestamp", "UNIX"] | |
timezone => ["Asia/Tokyo"] | |
target => "@timestamp" | |
} | |
mutate { | |
convert => { "source_port" => "integer" } | |
convert => { "dist_port" => "integer" } | |
} | |
geoip { | |
source => "source_ip" | |
} | |
} | |
output { | |
elasticsearch { | |
hosts => ["localhost:9200"] | |
index => "logstash-miraivariant-scan" | |
} | |
stdout { codec => rubydebug } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Logstashが取り込んだファイルの監視に使っているファイルであるsincedbのパスを変えたい場合はinputのfileフィルタ内に
として追記してください。ログの取り込みに失敗してもここで指定したsincedbを削除してLogstashの再起動をかければ、以前取り込んだファイルと同じファイルでも取り込んでくれます。