Repository navigation
internal/command: evaluate log lines as templates with --template - #213
Merged
Merged
Conversation
kcreddy
commented
Aug 19, 2026
Contributor
The log command streamed each line verbatim, so fixtures with absolute
timestamps eventually age out of time-windowed consumers (for example a
transform that filters on now-90d). Re-dating the fixtures by hand only
resets a ticking clock.
Add a --template flag that evaluates each line as a Go text/template
before sending, using the same function set as the http-server config
(env, hostname, sum, file, glob, minify_json, now). A streamed line can
then keep its timestamps current, for example:
"eventTime":"{{ (now "-720h").Format "2006-01-02T15:04:05Z07:00" }}"
Each line is rendered independently, and a template error aborts the run
reporting the offending line number. To keep one implementation, the
template function map and helpers move from internal/httpserver into a
new internal/templates package that both the http-server and the log
command use.
Updates elastic/integrations#20792
Co-authored-by: Opus 4.8 High
💚 Build Succeeded
cc @kcreddy |
Merged
1 of 5 tasks
efd6
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.