Skip to content

Commit

Permalink
Break out related.geo to validate the data exists first
Browse files Browse the repository at this point in the history
  • Loading branch information
dcode committed Jan 17, 2019
1 parent df88d06 commit b99c7ae
Showing 1 changed file with 30 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ filter {
mutate {
merge => { "[related][ip]" => "[network][client][ip]" }
# Add the location to related
add_field => {
"[related][geo]" => "%{[network][client][geo][location][latitude]},%{[network][client][geo][location][longitude]}"
}

if [network][client][geo] {
mutate {
merge => {
"[related][geo]" => ["%{[network][client][geo][location][latitude]},%{[network][client][geo][location][longitude]}"]
}
}
}
}
Expand All @@ -44,9 +49,14 @@ filter {
# Update related IPs
mutate {
merge => { "[related][ip]" => "[network][server][ip]" }
# Add the location to related
add_field => {
"[related][geo]" => "%{[network][server][geo][location][latitude]},%{[network][server][geo][location][longitude]}"
}

if [network][server][geo] {
mutate {
# Add the location to related
merge => {
"[related][geo]" => "%{[network][server][geo][location][latitude]},%{[network][server][geo][location][longitude]}"
}
}
}
}
Expand All @@ -67,9 +77,13 @@ filter {
# Update related IPs
mutate {
merge => { "[related][ip]" => "[network][source][ip]" }
# Add the location to related
add_field => {
"[related][geo]" => "%{[network][source][geo][location][latitude]},%{[network][source][geo][location][longitude]}"
}
if [network][source][geo] {
mutate {
# Add the location to related
merge => {
"[related][geo]" => "%{[network][source][geo][location][latitude]},%{[network][source][geo][location][longitude]}"
}
}
}
}
Expand All @@ -90,9 +104,14 @@ filter {
# Update related IPs
mutate {
merge => { "[related][ip]" => "[network][destination][ip]" }
# Add the location to related
add_field => {
"[related][geo]" => "%{[network][destination][geo][location][latitude]},%{[network][destination][geo][location][longitude]}"
}

if [network][destination][geo] {
mutate {
# Add the location to related
merge => {
"[related][geo]" => "%{[network][destination][geo][location][latitude]},%{[network][destination][geo][location][longitude]}"
}
}
}
}
Expand Down

0 comments on commit b99c7ae

Please sign in to comment.