Hi,
I am trying to get the date in the file name using following regex, but it still return a-zA-Z character:
Path:
/home/appadmin/Documents/ML/data/pocket_pmo/activityLogs20201211.csv
grok { match => { "path" => "(?<[@metadata][indexName]>[^/][\d]*)....$" } }
mutate {
add_field => {"indexname" => "%{[@metadata][indexName]}" }
}
result:
"indexname" => "s20201211"
May i know why the character 's' still there? How do i get only the date ?
Regards.