-
Notifications
You must be signed in to change notification settings - Fork 2.8k
filelog/syslog receiver and exporter problem. #40106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
otel-collector-values-apprecode.txt and output of syslog server were attached. |
Hey @recep-instructor, I think I understand where the problem is. You are reading the syslog logs from files like To fix that, you need to transform the logs so that they're understandable by the Syslog exporter. See the expected attributes here: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.126.0/exporter/syslogexporter/README.md#rfc5424. I would suggest to use the dedicated syslog parser, but I'm afraid it's no good for parsing syslog logs from the files, as they miss the header with the priority and version. Due to that, I recommend to configure the regex parser with a custom regex to set the right attributes. Here's a simple example: filelog/syslog:
include:
- /var/log/syslog
- /var/log/auth.log
- /var/log/messages
- /var/log/kern.log
start_at: beginning
include_file_path: true
include_file_name: true
operators:
- type: add
id: add-syslog-source
field: resource["log.source"]
value: "syslog"
- type: regex_parser
id: custom-syslog-parser
regex: '^(?P<timestamp>\S+) (?P<hostname>[^ ]+) (?P<appname>[^ ]+) (?P<message>.*)$'
timestamp:
parse_from: attributes.timestamp
layout: "%Y-%m-%dT%H:%M:%S.%f%j" I've added the It does seem to work on the logs in my
If the format in your syslog files is different, you might need to tweak the regex. Here's the docs for the regex_parser operator and for timestamp parsing. Let me know if this helps and any further questions. |
I appreciate you, I will try and inform you as soon as possible |
Component(s)
exporter/syslog
Describe the issue you're reporting
Hi,
I have been working on a project about OpenTelemetry Collector, Loki and Grafana for a long time. I have 1 k8s cluster (1 control node and 3 worker nodes). I have deployed Loki, Grafana and OpenTelemetry/Otel-Collector with Helm in this cluster. My aim is to send syslogs of k8s cluster to an external syslog server and to observe them from Grafana, and also to monitor logs of pods in k8s cluster from Grafana dashboard. I have been working on it for 10 days but I have some problems that I can't solve, one of them is regex problem. Logs are sent to Loki with Filelog/Syslog receiver, I can see them in Grafana, but logs are sent to external syslog server empty. I need urgent help on this issue, I would be grateful if a friend can help me. I am sharing my Otel-Collector-values.yml file.
The text was updated successfully, but these errors were encountered: