Splunk Search

Can I rename a range in the results of a transaction request

ssaenger
Communicator

HI All,

I am trying to get results from a transaction request from users coming into the out systems.
There are various authentication steps that take place and I would like to capture those steps. There are 5 steps in a successful transaction, however, sometimes users come into the system multiple times, due to some type of issue.

I have managed to rename each step, however, if the eventcount is greater than 5, I would like to rename it "Multiple entries" or something similar. However, I cannot work out how do it. Is this possible in Splunk? Otherwise, I end up with a table/graph with fields 6, 8,12 etc.

index=int_sgw sourcetype=int_sgw_log | transaction SUB_ID maxspan=3m  | chart count over host by eventcount | rename 1 AS "Radius ACCESS fail", 2 AS "Radius START fail", 3 AS "Login fail", 4 AS "Continue fail", 5 AS "Successful"

Thanks in advance.

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Integers cannot be renamed, but perhaps this method will do.

... | chart count over host by eventcount | eval result=case(1, "Radius ACCESS fail", 2, "Radius START fail", 3, "Login fail", 4, "Continue fail", 5, "Successful",1=1,"") | ...
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Integers cannot be renamed, but perhaps this method will do.

... | chart count over host by eventcount | eval result=case(1, "Radius ACCESS fail", 2, "Radius START fail", 3, "Login fail", 4, "Continue fail", 5, "Successful",1=1,"") | ...
---
If this reply helps you, Karma would be appreciated.

ssaenger
Communicator

Hi Rich,

Your answer put me on the right track. Below is how I got it to work.
Thanks for your prompt response 🙂

index=int_sgw sourcetype=int_sgw_log | transaction SUB_ID maxspan=3m  | eval eventcount=case(eventcount=="1","Radius ACCESS fail", eventcount=="2","Radius START fail", eventcount=="3","Login fail", eventcount=="4","Continue fail", eventcount=="5","Successful")| chart count over host by eventcount | rename NULL as Multiple_connections

jkat54
SplunkTrust
SplunkTrust

Try this:

 index=int_sgw sourcetype=int_sgw_log | transaction SUB_ID maxspan=3m  | chart count AS C over host by eventcount | eval C=if(match(C,"1"),"Radius ACCESS fail",if(match(C,"2"),"Radius START fail"),if(match(C,"3"),"Login fail",if(match(C,"4"),"Continue fail",if(match(C,"5"),"Successful","Multiple Entries")))))  
0 Karma

ssaenger
Communicator

Thanks for your response jkat54

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...