Sorry, mis-read it: See: https://hekad.readthedocs.org/en/latest/pluginconfig/logstreamer.html#mappings-with-missing-values
Try: priority = ["Year", "Month", "Day", "Seq"] [TCollectorLog.translation.Year] missing = 9999 On Mon, Oct 19, 2015 at 6:47 AM, Timur Batyrshin <[email protected]> wrote: > I’ve checked that doc while writing that. > In that case this is the same but the ordering for the number of the last > part becomes incorrect (1 is older, 2 is newer for my logs): > > Logstream name: [TCollectorLog] > Files: 6 (printing oldest to newest) > /var/log/tcollector/metrics.log > /var/log/tcollector/metrics.log-10-18-2015-2.gz > /var/log/tcollector/metrics.log-10-18-2015-1.gz > /var/log/tcollector/metrics.log-10-19-2015-3.gz > /var/log/tcollector/metrics.log-10-19-2015-2.gz > /var/log/tcollector/metrics.log-10-19-2015-1.gz > > Timur > > On 19 Oct 2015 at 16:43:38, Michael Trinkala ([email protected]) > wrote: > > Try: priority = ["Year", "Month", "Day", "^Seq"] > > See: > https://hekad.readthedocs.org/en/latest/pluginconfig/logstreamer.html#single-sequential-rotating-logfile > > Trink > > > On Mon, Oct 19, 2015 at 6:37 AM, Timur Batyrshin <[email protected]> wrote: > >> Hi all, >> >> >> I have the following list of logfiles: >> >> # heka-logstreamer -config=20-tcollector.toml >> Found 1 Logstream(s) for section [TCollectorLog]. >> >> Logstream name: [TCollectorLog] >> Files: 6 (printing oldest to newest) >> /var/log/tcollector/metrics.log >> /var/log/tcollector/metrics.log-10-18-2015-1.gz >> /var/log/tcollector/metrics.log-10-18-2015-2.gz >> /var/log/tcollector/metrics.log-10-19-2015-1.gz >> /var/log/tcollector/metrics.log-10-19-2015-2.gz >> /var/log/tcollector/metrics.log-10-19-2015-3.gz >> >> >> How should I write the regexp for the Logstreamer so that “metrics.log” >> would be the newest file but not the oldest? >> >> I’ve tried to do that like below that produces the result you see above. >> >> [TCollectorLog] >> type = "LogstreamerInput" >> log_directory = "/var/log/tcollector" >> file_match = >> 'metrics\.log(-(?P<Month>\d+)-(?P<Day>\d+)-(?P<Year>\d+)-(?P<Seq>\d*)\.gz)?' >> priority = ["Year", "Month", "Day", "Seq"] >> splitter = "split_on_newline" >> decoder = “tcollector_decoder" >> >> Any suggestions? >> >> Thanks, >> Timur >> >> _______________________________________________ >> Heka mailing list >> [email protected] >> https://mail.mozilla.org/listinfo/heka >> >> >
_______________________________________________ Heka mailing list [email protected] https://mail.mozilla.org/listinfo/heka

