-
Notifications
You must be signed in to change notification settings - Fork 156
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
WIP: Feature/extra template context #95
WIP: Feature/extra template context #95
Conversation
I have tested the change using:
Started as:
With the following log messages being posted:
And this as output:
|
Assuming this is something you'll consider merging, I will fix the broken tests, get the build to succeed, and then remove the |
Thanks a lot for this! I'll look into this in the next couple of days and get back to you. |
Thanks a lot, this sounds like a useful feature for users of the |
Cool, I'll finish the work on it. |
I don't seem to be able to reproduce the failing test in the appveyor/pr check.
Can you assist me with finding out what is going afoul here? |
Unfortunately, the Windows file tailor tests are flaky:
The test is simulating logrotate moving the logfile away, but after the If you have any idea how |
Thanks a lot!!! |
P.S.: After the merge Appveyor built without error again without any code change https://ci.appveyor.com/project/fstab/grok-exporter/builds/32644306 |
Are we sure that I don't believe that is the case in general, as Python calls So in general, I would not assume a Potential solutions:
|
This PR introduces a new pre-defined label variable, namely
extra
, which contains the entire JSON object parsed from the input, when using input typewebhook
with format being eitherjson_single
orjson_bulk
.It is flexible enough to be utilized by any input, which may want to provide a map as extra context for the label templating step.
The majority of changes has been made in the initial commit 6ee14ae, and simply involves changing the type of
additionalFields
frommap[string]string
tomap[string]interface{}
in order to support proper recursive data structures as extra context.An argument could have been made to go all the way to
data interface{}
as this is the type utilized for theExecute
method'sdata
argument on theTemplate
type, howevermap[string]interface{}
seemed like a good compromise.