Splunk Search

How to create this graph in splunk

Anidy21
Engager

I want to create this graph in splunk can some one please help me .

Required graph

Screenshot 2023-04-07 at 8.54.27 AM.png

 The one that i am getting after writing the following query is this

Query - index="BTS-card-account-update" exception="*" ("Payment instrument not found" OR "Wallet already has the updated card") | timechart count by host

Graph after my qurey

Screenshot 2023-04-07 at 9.12.14 AM.png

can some one please tell me how to get two separate line for both kind of exception separately.

Thanks in advance 🙂

 

Labels (2)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @Anidy21,

the problem is that, in the first graph events are plotted by kind of event, instead in your graph are plotted by host, you should try something like this:

index="BTS-card-account-update" exception="*" ("Payment instrument not found" OR "Wallet already has the updated card") 
| eval kind=if(searchmatch("Payment instrument not found"),"Payment instrument not found","Wallet already has the updated card")
| timechart count by kind

Ciao.

Giuseppe

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Anidy21,

the problem is that, in the first graph events are plotted by kind of event, instead in your graph are plotted by host, you should try something like this:

index="BTS-card-account-update" exception="*" ("Payment instrument not found" OR "Wallet already has the updated card") 
| eval kind=if(searchmatch("Payment instrument not found"),"Payment instrument not found","Wallet already has the updated card")
| timechart count by kind

Ciao.

Giuseppe

0 Karma

Anidy21
Engager

HI @gcusello 

After trying your query i am getting this result , can you please help me writing the query as i am very new to splunk 

Screenshot 2023-04-07 at 10.51.36 AM.png

 Still getting count for one type only

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Anidy21 ,

viewieng your graph, it seems that you have only events containing the string "Payment instrument not found"

could you share som sample of events containing both the strings?

Ciao.

Giuseppe

0 Karma

Anidy21
Engager

Hello @gcusello

yes you are write i only have even containing the string ""payment instrument not found"

when i replace other string which is present in the db i am getting desired graph/result

Thank you so so much for your help 🙂

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Anidy21 ,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

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!

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...