TCP input and answer to client

is it possible to do in logstash? i need to receive strings throuth tcp input and after succssesful recievment i need to answer the client with string for example "ok" or "bad format"

Should be something like this

input {
        tcp {
                type  => "syslog"
                port => 514 # default port
filter {
  if [message] == "somestring" { # you can use IN or Regex
    mutate { add_field => { "status" => "OK"} }	
    prune { whitelist_names => [ "status" ] }
output {
  tcp {
    host => "host or ip"
    port => 514
    stdout { codec => rubydebug{} }

But I need to answer the current client in the current tcp session.
tcp output will create a new connection to host and host must be as a server.

Try with adding tcp_keep_alive => true
If not work, maybe ES ingest pipeline can help.

logstash is not a web server, it provides no way to respond to a client sending data.

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