Skip to content

Commit 5afb43a

Browse files
committed
fix: update UTMStack filter version to 1.0.1 and refine JSON parsing logic
1 parent 89d829f commit 5afb43a

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

filters/utmstack/utmstack.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
# UTMStack filter, version 1.0.0
1+
# UTMStack filter, version 1.0.1
22

33
pipeline:
44
- dataTypes:
55
- utmstack
66
steps:
7+
# Only parse as JSON if it contains the standard schema with "msg": and "args":
78
- json:
8-
source: raw
9+
source: raw
10+
where: 'contains("raw", "\"msg\":") && contains("raw", "\"args\":")'
11+
12+
# If it doesn't have the standard schema, just store the content in log.message using grok
13+
- grok:
14+
source: raw
15+
patterns:
16+
- fieldName: log.message
17+
pattern: '{{.greedy}}'
18+
where: '!contains("raw", "\"msg\":") || !contains("raw", "\"args\":")'

0 commit comments

Comments
 (0)