Splunk Search

How to edit my search to change the output of certain strings in results?

SecureIA
Path Finder

Hi Helpful People,

I have a table which tells me perfectly well who is logged in to systems. My results show the words "Opened" and "Closed". I wish for them to say "In" or "Out" instead. Is there anyway that I can achieve this so that my results are more readable. My search is as follows:

host=?? NOT host=?? NOT host=?? NOT username=?? NOT username= ?? NOT username= ?? NOT username=?? "Session opened" OR "Session closed" | sort username time | chart latest(lstate) over username by host.
0 Karma
1 Solution

somesoni2
Revered Legend

You can use replace command for that. http://docs.splunk.com/Documentation/Splunk/6.3.3/SearchReference/Replace

host=?? NOT host=?? NOT host=?? NOT username=?? NOT username= ?? NOT username= ?? NOT username=?? "Session opened" OR "Session closed" | sort username time | chart latest(lstate) over username by host | replace "Opened" with "In" "Closed" with "Out" in *

View solution in original post

0 Karma

somesoni2
Revered Legend

You can use replace command for that. http://docs.splunk.com/Documentation/Splunk/6.3.3/SearchReference/Replace

host=?? NOT host=?? NOT host=?? NOT username=?? NOT username= ?? NOT username= ?? NOT username=?? "Session opened" OR "Session closed" | sort username time | chart latest(lstate) over username by host | replace "Opened" with "In" "Closed" with "Out" in *
0 Karma

SecureIA
Path Finder

Thank you so much!! I remember doing this a while back but had totally forgotten. Thanks for reminding me

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to July Tech Talks, Office Hours, and Webinars!

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

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

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...