Hi,
I trying to enrich the log with data (username) from postgres by user id.
However I didn't find a way to add the result as a field instead of a list. Is there a way to do so with the jdbc_streaming filter?
Actual result:
{
"id" => "id1",
"username" => [
[0] {
"username" => "user1"
}
]
}
Desired format:
{
"id" => "id1",
"username" => "user1"
}
The current pipeline:
input {
http {
}
}
filter {
jdbc_streaming {
jdbc_driver_library => "/.../postgresql-42.2.5.jar"
jdbc_driver_class => "org.postgresql.Driver"
jdbc_connection_string => "jdbc:postgresql://..."
jdbc_user => "..."
jdbc_password => "..."
statement => "select username from users where id = :id"
parameters => { "id" => "id"}
target => "username"
}
}
output {
stdout {}
}