Skip to content

Commit

Permalink
Windows otel upgrade (#151)
Browse files Browse the repository at this point in the history
* Updated opentelemetry-collector version

* Fix Empty Fields in event_data for Application Channel Logs

Enhanced log processing for the application channel by flattening event_data and correcting field names with regex. This solution addresses issues with empty fields in event_data, ensuring more consistent and readable log entries. Changes include deep flattening and pattern replacement to standardize data field names.
  • Loading branch information
bardabun authored Mar 3, 2024
1 parent d08c162 commit 06d996e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configs/1-1-localhost-windows-system.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"hint": "Switch the toggle on if you want Logz.io Telemetry Collector to collect logs from your computer.",
"otel": {
"receivers": ["filelog","windowseventlog_application","windowseventlog_security","windowseventlog_system"],
"processors": ["resourcedetection_system"]
"processors": ["resourcedetection_system", "transform_application"]
},
"params":
[
Expand Down
8 changes: 8 additions & 0 deletions resources/otel/processors/transform_application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
transform:
error_mode: ignore
log_statements:
- context: log
statements:
- flatten(body["event_data"], depth=1)
- flatten(body["event_data"], depth=2)
- replace_all_patterns(body["event_data"], "key", "data.([0-9]).", "data_$$1")
2 changes: 1 addition & 1 deletion scripts/windows/consts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $script:JqUrlDownload = 'https://github.com/stedolan/jq/releases/download/jq-1.6
# Url for downloading yq exe
$script:YqUrlDownload = 'https://github.com/mikefarah/yq/releases/download/v4.27.5/yq_windows_amd64.exe'
# Url for downloading OTEL collector zip
$script:OtelCollectorUrlDownload = 'https://github.com/logzio/otel-collector-distro/releases/download/v0.82.0/otelcol-logzio-windows_amd64.zip'
$script:OtelCollectorUrlDownload = 'https://github.com/logzio/otel-collector-distro/releases/download/v0.95.0/otelcol-logzio-windows_amd64.zip'
# Url for downloading eksctl zip
$script:EksctlUrlDownload = 'https://github.com/weaveworks/eksctl/releases/download/v0.133.0/eksctl_Windows_amd64.zip'
# Url for AWS SQS
Expand Down

0 comments on commit 06d996e

Please sign in to comment.