Skip to content

variable as value for grok pattern #459

Answered by jszwedko
camilisette asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @camilisette !

At this time, parse_grok requires a literal since compiling grok expressions at runtime is expensive. In your case the compiler could grow to be smart enough to realize that the variable will map to a literal that can be precompiled, but it isn't currently. Instead I think you'll need to use if/else statements rather than a dictionary lookup. I think #151 is tracking improvements to the compiler that might enable the dictionary lookup you have.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by camilisette
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants