-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
JSON parser: adding of string fields not explicitly specified #4912
Comments
We should add glob support to
This sounds interesting, can you explain further how this could work? |
What I was thinking about here, was adding a special key to the JSON, containing a map with the these parameters to override. That key should probably be something not valid as a field name, like beginning with a '.'. Let's call it '.telegraf_params' in the example below (I don't really care about the name). So to override these fields in a JSON sent, it could look like this:
|
Hi, I'm adding my 2 cents on this issue. Actually, json output format output data in a document that looks like: {
"name": "...",
"timestamp": ...,
"tags": [ ... ],
"fields": [ ... ]
} I could use this output format to send metrics or logs through kafka for example and collect them on the other hand with an
This would provide a generic way to collect metrics/logs from different sources. The filtering would then be done in chronograf ( EDIT: there's a question regarding EDIT2: found #2252 that is exactly what I would expect |
I replace "v==k" by regexp.Match 187 //remove any additional string/bool values from fields
188 for k := range fields {
189 //check if field is in StringFields
190 sField := false
191 for _, v := range p.StringFields {
192 if ok,_ := regexp.Match(v,[]byte(k));ok{
193 sField = true
194 }
195 }
196 if sField {
197 continue
198 } is only a temporary measure,though. |
Feature Request
The JSON parser should be more flexible concerning what to do with passed bool or string fields.
Proposal:
I see three options:
Current behavior:
All string or bool fields not explicitly specified in json_string_fields are discarded.
Desired behavior:
A method to include such fields in bulk
Use case:
The text was updated successfully, but these errors were encountered: