-
Notifications
You must be signed in to change notification settings - Fork 8
/
flight-track-logstash.conf
55 lines (55 loc) · 1.48 KB
/
flight-track-logstash.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
input {
http_poller {
urls => {
dump1090 => "http://localhost:8080/data.json"
}
request_timeout => 60
schedule => { "every" => "1m" }
codec => "json"
}
}
filter {
if "_jsonparsefailure" in [tags] { drop { } }
if "_http_request_failure" in [tags] { drop { } }
if [flight] {
mutate { strip => ["flight"] }
ruby {
code => 'event.set("[airline]", event.get("[flight]")[0..2])'
}
}
if [flight] == "" {
mutate {
remove_field => ["flight", "airline"]
add_field => {
"flight" => "unknown"
"airline" => "unknown"
}
}
}
if [validposition] { mutate { replace => { "validposition" => "true" } } } else { mutate { replace => { "validposition" => "false" } } }
if [validtrack] { mutate { replace => { "validtrack" => "true" } } } else { mutate { replace => { "validtrack" => "false" } } }
mutate {
remove_field => ["message"]
remove_field => ["response_headers", "code", "response_message", "time_retried", "runtime_seconds"]
}
if [lat] and [lon] {
mutate {
add_field => ["location", "%{lat}, %{lon}"]
remove_field => ["lat", "lon"]
}
}
}
output {
# stdout { codec => rubydebug { metadata => true } }
if [validtrack] {
elasticsearch {
#hosts => ""
#user => ""
#password => ""
index => "flight-track-%{+YYYY}"
template => "flight-track-template.json"
template_name => "flight-track"
template_overwrite => true
}
}
}