Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decorate_events is missing to catch message size #306

Open
TomonoriSoejima opened this issue Jan 17, 2019 · 0 comments
Open

decorate_events is missing to catch message size #306

TomonoriSoejima opened this issue Jan 17, 2019 · 0 comments

Comments

@TomonoriSoejima
Copy link

TomonoriSoejima commented Jan 17, 2019

  • Version: 8.1.1
  • Operating System: OS X 10.14.2
  • Config File
input {
  kafka {
    bootstrap_servers => "localhost:9092"
    topics => ["test"]
    decorate_events => true
    codec => plain
  }
}

filter {
        json {
                source => "message"
        }
        mutate {
            add_field => {
                "kafka" => "%{[@metadata][kafka]}"
            }
        }
}

output {
        stdout { codec => rubydebug }
        elasticsearch {
                hosts => "localhost:9200"
        }
}
  • Steps to Reproduce:

I tried to capture message size with config above but all I end up in es is below.

  {
        "_index": "logstash-2019.01.17",
        "_type": "doc",
        "_id": "c6K9WWgBM1pL-G5k3dHw",
        "_score": 1,
        "_source": {
          "@timestamp": "2019-01-17T02:57:21.702Z",
          "kafka": """{"topic":"test","consumer_group":"logstash","partition":0,"offset":18,"key":null,"timestamp":1547693840696}""",
          "name": "Sam",
          "message": """{"name":"Sam"}""",
          "@version": "1"
        }
      }

The doc says Option to add Kafka metadata like topic, message size to the event.

Looking at https://github.com/logstash-plugins/logstash-input-kafka/blob/master/lib/logstash/inputs/kafka.rb#L258, it appears that size is not being captured and I wonder if that is a limitation of kafka or not.

Neither kafka-console-producer and kafka-console-consumer mention size in its help at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant