Unable to index JSONB column from Postgresql View

Hi all,

I have a view in Postgres with a single column of type jsonb. To get around some weirdness, I decided to update the view and cast this column as text (it appears I'm not able to access a PGObject, hence the update). When the rows are processed, they're processed with "search_documents" as the top level key in the object and the original JSON object as the value. This isn't quite what I was looking for, the JSON in these columns are already objects and they're also valid JSON. Below is my configuration.

input {
jdbc {
jdbc_connection_string => "jdbc:postgresql://host:5432/master?user=xxx&password=xxx"
jdbc_user => "xxx"
jdbc_validate_connection => true
jdbc_driver_library => "/usr/share/java/postgresql-jdbc4-9.2.jar"
jdbc_driver_class => "org.postgresql.Driver"
statement => "SELECT search_documents from views.constructed_documents"
jdbc_fetch_size => 10000
}
}
filter {
json {
source => "[search_documents][value]"
}
}
output {
stdout {
codec => rubydebug
}
}

Update:

I've also tried constructing my JSON objects with a vanity key, like this:

{ "value" : { "rest_of_my_document" : "" } }

But, no matter what I do, whatever comes out of Postgres is indexing into Elasticsearch. It seems as if the JSON filter is not having an impact at all.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.