Getting Data In

Eval

Khuzair81
Path Finder

c= US

Language = abcdENGLISH123qw

..... | rex fields=Language "\w{4}(?<myval>)\d{4}"

| eval ans=case(c="US",myval, true(), "NA" ) | table ans, myval, c

Result

ans = NA

myval = English

c = US

 

I want the ans = English

Labels (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Khuzair81 

Can you please try this?

YOUR_SEARCH
| rex field=Language "^[a-zA-z]{4}(?<myval>\w+)\d{3}" 
| eval ans=case(c="US",myval, true(), "NA" ) 
| table ans, myval, c

 

My Sample Search :

 

| makeresults 
| eval c="US",Language="abcdENGLISH123qw" 
| rex field=Language "^[a-zA-z]{4}(?<myval>\w+)\d{3}" 
| eval ans=case(c="US",myval, true(), "NA" ) 
| table ans, myval, c


 

Thanks
KV
▄︻̷̿┻̿═━一

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...