Splunk Search

piechart

avneet26
Engager

I want to create two pie chart each based upon the value of index I am choosing. using below two queries

 

1. index = index1 host=.......| ...

2. index=index2 host=....|

then i want to include both of these pie charts into the same report so that I can send them as alert in the same mail. How can I do that ? tried append and multi search but didnt help.

0 Karma

avneet26
Engager

it didnt give any results. my concern is how can I generate two different pie charts using these two searches and those two pie charts should be different based on index values(one for index1 other for index2)

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Sorry, I misunderstood, I thought you were trying to use two indexes in the same chart. The chart is a visualisation of the results of a query. I don't think there is a standard pie chart visualisation that produces multiple charts. Perhaps you should submit this as an improvement request.

0 Karma

avneet26
Engager

search index= index1
host=*
source=*logs* username
sourcetype=* | rex "user\":\"(?<user>[^\"]+)" | stats count by user] |
append [search index= index2
host=*
source=*logs* user
sourcetype=* | rex "user\":\"(?<user>[^\"]+)" | stats count by user]

 

this didnt work for me

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

In what way didn't it work? No result? Incorrect results? host missing?

Are these event similar, just in different indexes? Can you use:

search index=index1 OR index=index2
host=*
source=*logs* username
sourcetype=* | rex "user\":\"(?<user>[^\"]+)" | stats count by user

or 

| stats values(index) as index count by user

 or

| stats count by user index
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Can you be a bit more specific about what you tried and why it didn't work? Append and multiple searches sound like they would normally solve the problem, so without further information, it is difficult to advise.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...