Skip to content

Use regular expressions to determine whether the content contains #13876

Answered by tobz
tiantian34 asked this question in Q&A
Discussion options

You must be logged in to vote

@tiantian34 There are VRL functions for checking if a string matches a regular expression, but there's also a few other string-related functions for checking for if a string contains a substring, which may be beneficial to you given your example:

  • contains will allow you to check to see if a substring is contained within a string
  • starts_with/ends_with will let you check if a string starts with, or ends with, a specific substring
  • match allows you to check if a string matches a regular expression (and match_any lets you check against multiple regular expressions at the same time)

You can see some examples of using the remap transform, including writing VRL, in the examples section here: ht…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tobz
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