How logstash reads a log file from a subfolder


(Vikas Gopal) #1

HI Experts,

My logs are placed in the following directory structure

logs/
Cust1/2015/Sep-09/cisco.log
.................
.................
...........
Cust1/2015/Sep-10/cisco.log

Here log is the main directory then I have sub directories Cust1 , 2015, Sep-9 or Sep 10, then I have log.

Now what i want is to read the log files from all the dynamic sub folders , like from Sep-9, Sep-10.

Please suggest how I can achieve this


(Magnus B├Ąck) #2

Just use wildcards.

input {
  file {
    path => ["/path/to/logs/Cust1/*/*/cisco.log"]
  }
}

(Vikas Gopal) #3

Thank You Mangnus,

It works..


(system) #4