You would have to parse the source field in either Logstash or Ingest Node and then set the index based on that. You cannot parse the filename directly in Filebeat.
Depending on the number of permutations you have you could take a simpler approach. The example below would set the index based on a static field defined in the prospector config.
static field is not so flexible,because there are many directory in /var/log/,currently,we use logstash to achieve this,logstash parse source can also slove the problem. could filebeat provide a way to achieve this in the future,thus we will use logstash less often!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.