Logstash configuration File

input {
  file {
    type => "json"
    path => "/home/harsh/Documents/elklog/2022/01/1/*.json"
    start_position => "beginning"
    sincedb_path => "/dev/null"
  }
}

filter {

}

output {
  stdout { codec => rubydebug }
  elasticsearch{
	hosts => ["localhost:9200"]
	user => elastic
    password => elastic
    index => "logstash_index"
    document_type => "json"
  }
}

in this configuration file,
I want to change path Dynamically so is it possible or not ? If yes then How to do that ?

What does "change path dynamically" mean?

Suppose i have Folder like YYYY/MM/DD in year there is all Months folder so i want to need specific folder log data so All time i have to change in conf file so is it any way to create path Dynamically so my work done easily hope you got my point

Thank you @Tomo_M

You can use wildcard even for folder path not only for file name. Is this help you?

1 Like

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