-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syslog structured_data
field loses structure in Attributes
field
#26730
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@ttomsu, thanks for reporting this, and especially for finding the relevant code. I agree it's not handled correctly.
I'm not understanding what you are suggesting here. Can you clarify how this would be used in our code?
I think perhaps a version of this which applies specifically to structured data makes sense. e.g. As much as I'd like to avoid stingified maps as a default, I think we are in a tough spot here because we need to respect some general expectations:
Another option would be that we flatten the structured data string into a dot-notation. e.g. {
"foo": {
"hello": "world",
"one": "two"
},
"bar": {
"three": "four"
}
} is flattened into the following attributes:
Again, if we went this route, I think we should make it opt-in since it's somewhat abnormal behavior. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been closed as inactive because it has been stale for 120 days with no activity. |
Component(s)
receiver/syslog
What happened?
Description
When the syslog receiver uses RFC5424 structured data, that data get stuffed into the
Attributes
here. Unfortunately, thismap[string]map[string]string
type is not recognized by the converter, and the resulting map loses all structure as it gets stringified by thedefault
block.Steps to Reproduce
You can use the same
github.com/influxdata/go-syslog/v3/rfc5424
package used internally to create aSyslogMessage
with structured data that gets squashed:Expected Result
I expected
logRecord.Attributes().Get("structured_data")
to return apcommon.ValueTypeMap
- though I can see why, because I think according to the spec attributes are string -> string.Because of this, I also thought maybe I could change the
parse_to
field like in other receivers, but it looks like that's baked in.Actual Result
It returns a ValueTypeStr
Collector version
0.85.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: