Hi
we are looking for solution to read the file from the latest folder in the input path .
our current configuration is as follows,
input {
file {
path => "/var/log/orglogs//G.log"
start_position => "end"
}
}
we have multiple folders in side /var/log/orglogs/ with date as the name of the folder. that will 2016-7-01, 2016-7-02 etc .... ! instead of reading out from we want the logstash configuration to read only from the current date .
Is there a way we can use a parameter to set todays date and pass that parameter to the path , as follows,
latestdate => date +%Y-%-m-%d
path => "/var/log/orglogs/$latestdate/G*.log
PS NOTE:
- we can fix the same with logrotate the file on the old folder, but due to the size of the file it takes times and results in delay in reading new file rather logstash reads old file
- we tried to create symlink to point to latest directly and it works as well, But we need the date of the folder as field in our grok pattern . When using symlink we get the symlink name instead of the original folder name.
Can some one help ??
Thanks in Advance
Govind