Logstash syncing from Mongodb to Elasticsearch - Null values in array data objects

Hello Community,

I'm using logstash to sync data from Mongdb to Elasticsearch & Kibana using JDBC input plugin. But array data fields are being synced as NULL values in ES/Kibana.

Below is logstash.conf:

input {
          jdbc {
            type => "courses_data"
            jdbc_driver_library => "/usr/share/logstash/logstash-core/lib/jars/mongojdbc4.1.jar"
            jdbc_driver_class => "com.mongodb.MongoClient"
            jdbc_connection_string => "********"
            jdbc_user => "admin"
            jdbc_password => "****"
            jdbc_validate_connection => true
            schedule => "*/30 * * * * *"
            use_column_value => true
            tracking_column => "_id"
            tracking_column_type => "numeric"
            statement => "select * from courses"
          }
      
        }

        filter
        {
          if [type] == "courses_data"
          {
            mutate
            {
                rename => { "_id" => "course_id" }
            }
          }

        }
        output {
          stdout {
              codec => rubydebug
          }
          
          if [type] == "courses_data" {
              elasticsearch {
                action => "update"
                doc_as_upsert => true
                document_id => "%{course_id}"
                index => "courses_data"
                hosts => ["elasticsearch:9200"]
                ssl_certificate_verification => false
              }
          }

        }

Below is the sample data field which is being synced as NULL in ES.

"tags": ["mwi", "metalworks institute", "publishing", "copyright", "SU-T1000"],

How can I sync array fields from mongdb into ES/Kibana ?

TIA

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