Splunk Search

If - Then Logic in Table Results With Column Value Based on Field Results in Search

SplunkLunk
Path Finder

Good morning,

I have a search that looks through and Oracle database for an ACTION_NAME:

source="dbx:[DB source]" sourcetype="oracle:audit:trail" USERNAME!=SYS AND ACTION_NAME=LOGON

Those events also include a RETURNCODE which defines if it was a successful logon. For example if the ACTION_CODE=LOGON and RETURNCODE=0, then it was a successful login. If ACTION_CODE=LOGON and RETURNCODE!=0, then it was a failed logon. How can I build a table that displays the RETUNRCODE as a text value of "Failed" or "Successful" based on the RETURNCODE value of 0 or <>0?

Any help would be appreciated. Thanks.

Tags (1)
0 Karma
1 Solution

rjthibod
Champion

You can add the following to your query

| eval LogonStatus = if (RETURNCODE==0, "Successful", "Failed")

After that you will have a new field LogonStatus that you can use in your table as you see fit.

View solution in original post

0 Karma

rjthibod
Champion

You can add the following to your query

| eval LogonStatus = if (RETURNCODE==0, "Successful", "Failed")

After that you will have a new field LogonStatus that you can use in your table as you see fit.

0 Karma

SplunkLunk
Path Finder

Thank you! That is exactly what I am looking for! Much Appreciated.

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...