Skip to main content
ANMAR
Silver ⭐️⭐️⭐️
Sep 9, 2019 4:53 PM UTC
Solved

ExtractText picking up the first match.

I have an event  {

"a":"avc123.abc.com",
"b":"24 - ny",
"c" : "21321kodi"
}

i would like to use extracttext to filter/extract only the "b" however, it is picking up the first match. How can I specify to extract text from field "b" only not "a" neither "c"


Shu_ashu
Shu_ashuAnswer
Gold ⭐️⭐️⭐️
Sep 10, 2019 4:07 AM UTC

@ANMAR 

Try with this regex

(?:"b"\s*:\s*)"(.*?)",

This will extract only 24 - ny value from the given event

2 replies

Shu_ashu
Shu_ashuAnswer
Gold ⭐️⭐️⭐️
Sep 10, 2019 4:07 AM UTC

@ANMAR 

Try with this regex

(?:"b"\s*:\s*)"(.*?)",

This will extract only 24 - ny value from the given event

Translate
ANMAR
ANMARAuthor
Silver ⭐️⭐️⭐️
Sep 10, 2019 2:59 PM UTC

Found the solution! 
Just needed to apply the regex 

(?:"b":.\w+?)(\d+)

thanks to @Shu_ashu  

Translate