Use grok filter to extract date and time:
filter { grok { match => [ "path", "^%{GREEDYDATA}/[^/]+_%{INT:date}_%{TIME:time}\.txt$" ] } }
Depending on what happens instead of XXXXXX_XX, you might prefer a more strict expression. In addition, GREEDYDATA is not very effective. This can lead to increased performance:
filter { grok { match => [ "path", "^(?:/[^/]+)+/[^/]+_%{INT:date}_%{TIME:time}\.txt$" ] } }
source share