json
stage
This stage uses the Go JSON unmarshaler, which means non-string types likenumbers or booleans will be unmarshaled into those types. The extracted datacan hold non-string values and this stage does not do any type conversions;downstream stages will need to perform correct type conversion of these valuesas necessary. Please refer to the the template
stage for howto do this.
If the value extracted is a complex type, such as an array or a JSON object, itwill be converted back into a JSON string before being inserted into theextracted data.
Examples
Given the following log line:
The following key-value pairs would be created in the set of extracted data:
output
:log message\n
stream
:timestamp
:2019-04-30T02:12:41.8443515
Using extracted data
And the given log line:
The first stage would create the following key-value pairs in the set ofextracted data:
stream
:stderr
- :
2019-04-30T02:12:41.8443515
extra
:{"user": "marco"}