Why collect the same log when I set different port?

I have two conf file in /etc/logstash/conf.d/.
One is named "nas_ftp.conf" and include below setting:```

input {
     tcp {
       port => 10515
     }
   }

   filter { }
   output {
     elasticsearch {
       hosts => ["IP:9200"]
       index => "nas_ftp_log_%{+YYYY.MM.dd}"
     }
   }

and the other one is named "ftp_log.conf" and include :

input {
  tcp {
    port => 10514
  }
}

filter { }


output {
  elasticsearch {
    hosts => ["IP:9200"]
    index => "ftp_log_%{+YYYY.MM.dd}"
  }
}

Why I collect the same log in differents index and ports?

Does this post help?

hi, I see your post.
Then I combined my conf file and name "ftp_log.conf " like this:

input {
  tcp {
    port => 10514
  }
  tcp {
    port => 10515
  }
}

filter { }

output {
 if[port]==10514{
  elasticsearch {
    hosts => ["10.190.253.47:9200"]
    index => "ftp_log_%{+YYYY.MM.dd}"
  }
  }
   if[port]==10515{
  elasticsearch {
    hosts => ["10.190.253.47:9200"]
    index => "nas_ftp_log_%{+YYYY.MM.dd}"
  }
  }
}

But I got error

[2020-12-10T14:36:57,682][INFO ][logstash.config.source.local.configpathloader] No config files found in path {:path=>"/etc/logstash/conf.d/syslog.conf"}
[2020-12-10T14:36:57,689][ERROR][logstash.config.sourceloader] No configuration found in the configured sources.

It is telling you that /etc/logstash/conf.d/syslog.conf does not exist.

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