Skip to content

Commit

Permalink
chore: use more elegant way
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Rosiek <[email protected]>
  • Loading branch information
Dominik Rosiek committed Dec 7, 2023
1 parent 00f906f commit 68bd309
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion deploy/helm/sumologic/conf/events/otelcol/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ processors:
log_statements:
- context: log
statements:
- set(time, Now()) where time_unix_nano == 0
- set(attributes["timestamp"], Int(time_unix_nano / 1000000))
- set(attributes["timestamp"], UnixMilli(Now())) where attributes["timestamp"] == 0

receivers:
raw_k8s_events: {}
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/sumologic/conf/logs/otelcol/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ processors:
log_statements:
- context: log
statements:
- set(time, Now()) where time_unix_nano == 0
- set(attributes["timestamp"], Int(time_unix_nano / 1000000))
- set(attributes["timestamp"], UnixMilli(Now())) where attributes["timestamp"] == 0

## Move attributes from the body to the record and drop the body if it's a map
## The map check isn't perfect, as there's no way to check for this explicitly in OTTL
Expand Down
3 changes: 1 addition & 2 deletions tests/helm/testdata/goldenfile/events_otc/basic.output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ data:
log_statements:
- context: log
statements:
- set(time, Now()) where time_unix_nano == 0
- set(attributes["timestamp"], Int(time_unix_nano / 1000000))
- set(attributes["timestamp"], UnixMilli(Now())) where attributes["timestamp"]
== 0
receivers:
raw_k8s_events: {}
service:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ data:
log_statements:
- context: log
statements:
- set(time, Now()) where time_unix_nano == 0
- set(attributes["timestamp"], Int(time_unix_nano / 1000000))
- set(attributes["timestamp"], UnixMilli(Now())) where attributes["timestamp"]
== 0
receivers:
raw_k8s_events: {}
service:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,8 @@ data:
log_statements:
- context: log
statements:
- set(time, Now()) where time_unix_nano == 0
- set(attributes["timestamp"], Int(time_unix_nano / 1000000))
- set(attributes["timestamp"], UnixMilli(Now())) where attributes["timestamp"]
== 0
transform/containers_parse_json:
error_mode: ignore
log_statements:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,8 @@ data:
log_statements:
- context: log
statements:
- set(time, Now()) where time_unix_nano == 0
- set(attributes["timestamp"], Int(time_unix_nano / 1000000))
- set(attributes["timestamp"], UnixMilli(Now())) where attributes["timestamp"]
== 0
transform/containers_parse_json:
error_mode: ignore
log_statements:
Expand Down

0 comments on commit 68bd309

Please sign in to comment.