The tutorial recommends using /var/lib/teleport/log/*.log as pathExpression to configure sumo sources. However when I configured the sumologic collector that way it started following every file in /var/lib/teleport/log/ (which was more than 100 files because we keep the logs for a long time).
I tried to configure fluentd to keep track of the latest log file only using the following configuration:
I followed https://gravitational.com/blog/shipping-ssh-logs-to-sumologic/ to configure sending ssh logs to sumologic. But instead of the sumologic/collector docker image, I used https://github.com/SumoLogic/fluentd-kubernetes-sumologic because it has already been used for kubernetes and containers logs.
The tutorial recommends using /var/lib/teleport/log/*.log as pathExpression to configure sumo sources. However when I configured the sumologic collector that way it started following every file in /var/lib/teleport/log/ (which was more than 100 files because we keep the logs for a long time).
I tried to configure fluentd to keep track of the latest log file only using the following configuration:
where /mnt/teleport/ is a mount of /var/lib/gravity/site/teleport/log/. The corresponding fluentd documentation can be found at https://docs.fluentd.org/v1.0/articles/in_tail
Here I ran into problems.
These 2 issues cause fluentd to start reading the latest log file in 12 + local_timezone_difference_with_UTC hours which is a very big delay.
I wonder if it is possible to make this naming convention more predictable and easier to use for log aggregator software?
For instance, teleport could write current records to current.log or last.log, and rotate it to YYYY-mm-DD.00:00:00.log when it is time to rotate.