Created
June 28, 2021 12:20
-
-
Save ereshzealous/33a7cfa7040d9fbed0b0acf62cd0273e to your computer and use it in GitHub Desktop.
This file contains 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 { | |
kafka{ | |
codec => json | |
bootstrap_servers => "localhost:9092" | |
topics => ["elastic-test"] | |
} | |
} | |
filter { | |
mutate { | |
add_field => { | |
"id" => "%{[data][id]}" | |
} | |
add_field => { | |
"firstName" => "%{[data][firstName]}" | |
} | |
add_field => { | |
"lastName" => "%{[data][lastName]}" | |
} | |
add_field => { | |
"city" => "%{[data][city]}" | |
} | |
add_field => { | |
"country" => "%{[data][country]}" | |
} | |
add_field => { | |
"email" => "%{[data][email]}" | |
} | |
add_field => { | |
"phoneNumber" => "%{[data][phoneNumber]}" | |
} | |
add_field => { | |
"createdAt" => "%{[data][createdAt]}" | |
} | |
remove_field => ["data", "@version", "@timestamp", "message", "event", "globalId"] | |
} | |
} | |
output { | |
stdout { | |
codec => json_lines | |
} | |
elasticsearch { | |
hosts => ["localhost:9200"] | |
index => "kafka_test" | |
document_id => "%{id}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment