Skip to content

How to use the name of the input in VRL? #11934

Answered by StephenWakely
smitsr72 asked this question in Q&A
Discussion options

You must be logged in to vote

So, supposing you had a field called name in your input, you could write something like the following:

if .name == "flub" {
  # Do the thing when name is flub.
} else {
  # Do the thing when name is not flub.
}

You can find more details here.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@smitsr72
Comment options

@StephenWakely
Comment options

@smitsr72
Comment options

@StephenWakely
Comment options

Answer selected by StephenWakely
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