Splunk Search

Calculated field

VijaySrrie
Builder

Hi Team,

I need to create 3 calculated fields

| eval action=

case(error="invalid credentials", "failure", ((like('request.path',"auth/ldap/login/%") OR like('request.path',"auth/ldapco/login/%")) AND (valid="Success")) OR (like('request.path',"auth/token/lookup-self") AND ('auth.display_name'="root")) ,"success")

| eval app=

case(action="success" OR action="failure", "appname_Authentication")

| eval valid=

if(error="invalid credentials","Error","Success")



action field is dependant on valid
app field is dependant on action

I am unable to see app field in the splunk, may I know how to create it?

Labels (2)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @VijaySrrie ,

they should work also using three different calculated fields, anyway, you could nest the conditions from the other calculated fields, even if the final caculated fied will be longer:

| eval action=
case(error="invalid credentials", "failure", ((like('request.path',"auth/ldap/login/%") OR like('request.path',"auth/ldapco/login/%")) AND (NOT error="invalid credentials")) OR (like('request.path',"auth/token/lookup-self") AND ('auth.display_name'="root")) ,"success")

| eval app=case(action="success" OR action="failure", "appname_Authentication")

| eval valid=if(error="invalid credentials","Error","Success")

Ciao.

Giuseppe

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...