-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Log Truncation Issue When Forwarding Jenkins Logs to Splunk via OTEL #38909
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. |
Pinging code owners for exporter/splunkhec: @atoulme @dmitryax. See Adding Labels via Comments if you do not have permissions to add labels yourself. For example, comment '/label priority:p2 -needs-triaged' to set the priority and remove the needs-triaged label. |
@stedliu I changed this to issue
Can you share such file before you make any modification? This seems to hint that the line is not finished and the |
Uh oh!
There was an error while loading. Please reload this page.
Component(s)
receiver/splunkhec
What happened?
Description
I am experiencing a log truncation issue when using OpenTelemetry Collector to forward Jenkins job logs to Splunk. The truncation happens at a specific location in the logs, and the log cuts off after the line with git fetch ....
If I manually add a character at the end of the log line (for example, at the end of the "git fetch ..." line), the full log appears correctly. However, the truncation issue persists if no changes are made to the log.
Steps to Reproduce
Set up OpenTelemetry Collector to forward Jenkins job logs to Splunk.
Use the following configuration for filelog receiver and exporters:
filelog/jenkins:
include:
- /var/lib/jenkins/jobs//builds//log
include_file_name: false
include_file_path: true
operators:
- from: attributes["log.file.path"]
to: resource["com.splunk.source"]
type: move
- type: add
field: resource["com.splunk.sourcetype"]
value: jenkins
- type: add
field: resource["com.splunk.index"]
value: {{ .project_code }}_app
- type: add
field: resource["environment"]
value: xxx
- type: add
field: resource["aws_account"]
value: xxx
- type: regex_parser
regex: (?P[\s\S]*)
Observe the truncation in the Jenkins log, specifically after the git fetch line.
Expected Result
The full Jenkins job log should be forwarded without truncation, especially for long logs with git operations.
Started by timer
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building in workspace /var/lib/jenkins/workspace/DB-CheckDupDNS
The recommended git tool is: NONE
using credential b02d020e-f21a-4c22-a239-85b043c1fe38
++ tail -n 1
++ sort -t. -n -k2,2
++ grep '[0-9]$'
++ ls /usr/bin/python3.11 /usr/bin/python3.9 /usr/bin/python3.9-config /usr/bin/python3.9-x86_64-config
No emails were triggered.
Finished: SUCCESS
Actual Result
Logs are truncated at a specific location (usually after the git fetch line), and the rest of the log is missing.
Started by timer
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building in workspace /var/lib/jenkins/workspace/DB-CheckDupDNS
The recommended git tool is: NONE
using credential b02d020e-f21a-4c22-a239-85b043c1fe38
*** Adding a character manually at the end of "> git fetch" line fixes the issue temporarily.
Collector version
otelcol --version otelcol version v0.112.0
Environment information
Environment
OS: Amazon Linux 2023
Splunk version: 9.3.1
Jenkins version: 2.452.2
OpenTelemetry Collector configuration
Log output
Additional context
No response
The text was updated successfully, but these errors were encountered: