Skip to content

Commit

Permalink
Improved parsing of Litestream logs
Browse files Browse the repository at this point in the history
The collector properly parses the timestamp and severity, and adds the `service.name` attribute.
  • Loading branch information
clintonb committed Dec 21, 2023
1 parent 327c053 commit 633c208
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,19 @@ receivers:
filelog:
include: [ /opt/homebrew/Cellar/voripos-txn-sync/**/var/log/voripos-txn-sync.log ]
include_file_path: true
operators:
- type: json_parser
id: timestamp_parser
timestamp:
parse_from: attributes.time
# NOTE: We use gotime because striptime cannot handle the colon in the timezone offset:
# Example: 2023-12-21T08:16:11.890832-08:00
layout_type: gotime
layout: '2006-01-02T15:04:05.999999-07:00'
severity:
parse_from: attributes.level
attributes:
service: litestream
'service.name': litestream

processors:
batch:
Expand Down
2 changes: 1 addition & 1 deletion voripos-otel-collector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This is needed to locate the otelcol-contrib executable
export PATH="/opt/homebrew/bin:$PATH"

export VORIPOS_OTEL_COLLECTOR_VERSION=0.4.0
export VORIPOS_OTEL_COLLECTOR_VERSION=0.4.1
DEVICE_SERIAL_NUMBER=$(ioreg -c IOPlatformExpertDevice -d 2 | awk -F\" '/IOPlatformSerialNumber/{print $(NF-1)}')

OIDC_CLIENT_ID=
Expand Down

0 comments on commit 633c208

Please sign in to comment.