Logstash kafka topic as part of elasticsearch document_type

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]}"

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