Hi,
I am using multiple csv input files
with locations /user/location2/consumption-*.csv /user/location2/maps*.csv
Now in my logstash configuration i want to use conditional basis the path of csv files
input
{
file
{
path => [ "/user/location2/maps*.csv",
"/user/location2/consumption-*.csv"
]
start_position => "beginning"
# sincedb_path => "/user/somelocation/.sincedb"
}
}
filter {
The path field will contain the actual path to the file, not the wildcard you used in the file input's path option. You can use a regular expression match conditional (see documentation) to check whether the path field matches a pattern.
But... I think it would be cleaner to split your single file input into two file inputs that set a tag or a particular field to indicate what kind of data it is. Then you can use a simple conditional on that tag or field to decide which filtes to apply.
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.