Filtering messages from Logstash codec rubydebug output

Our logtsash conf file is using tcp input plugin to ingest messages from different ports.

The output part is as follows:

output {

    if [@metadata][indexPrefix] {

        file {
                path => "/opt/total/logs/ts/TCS_multi_debug.log"
                codec => rubydebug
                }

    elasticsearch {
     hosts => [ "xx-xx-xx-xx:33045" ]
     hosts => [ "xx-xx-xx-xx:33045" ]
     hosts => [ "xx-xx-xx-xx:33045" ]
     hosts => [ "xx-xx-xx-xx:33045" ]
     user => "elastic"
     password => "xxxxxxxxxxxxxx"
     index => "%{[@metadata][indexPrefix]}-%{+YYYY.MM.dd}"
     action => "index"
                        }
                }

        }

I want the /opt/total/logs/ts/TCS_multi_debug.log to only show/ write all messages related to a particular port in the input section.

Please guide me on how to achieve this.

Thanks

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