Logstash kafka topic as part of elasticsearch document_type


(Sulthon Zainul Habib) #1

I have tried this conf but not working

  input {
      kafka {    
        ...
        decorate_events => true
      }
    }

    filter {    
      mutate {
        add_field => {"[@metadata][topic]" => "%{[kafka][topic]}"}
      }
    }

    output {
      elasticsearch {
        document_type => "%{[@metadata][topic]}"
        ...
      }
    }

result of "%{[@metadata][topic]}"

"%{[kafka][topic]}"


(system) #2

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