Filter on TCP input plugin

I am fetching input using the TCP input plugin. I am hitting TCP endpoint with an API so while fetching data from the endpoint it fetches data like header information (Content-length, User-Agent etc) . So is there any way for fetching the only body of request?
Here are my configs for input plugin:

input {
	tcp {
		port => 5000
	}
}

filter {
  mutate {
      remove_field => ["host", "@version", "@timestamp", "port"]
  }
}


output {
      stdout { }
      kafka {
        bootstrap_servers => "kafka:9092"
        topic_id => "Topic"
     }
}```

The tcp input has no conception of headers vs. body. It just reads lines of data. Perhaps an http input would be a better fit for your use case.

@ [Badger] Thank you. I will check that

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