Splunk Search

how get combine result from two different search to a timechart

jackieh00
New Member

I have 2 search

search 1
index=A "testx" | stats count(user) AS total1 by _time

search 2
index=B "testx" | stats count(account) AS total2 by _time

I want a timechart span=1d with count total1, total2, and total1+total2.
I've tried this,
index=A "testx" | stats count(user) AS total1 by _time| appendcols [search index=B "testx" | stats count(account) AS total2 by _time] | eval total = total1 + total2| timechart span=1d count(total1), count(total2), count(total)

but the total only has total2 count. How can I fix this?

0 Karma

pradeepkumarg
Influencer
(index=A "testx" ) OR (index=B "testx")| timechart count(user) AS total1 count(account) AS total2 | eval total=total1+total2
0 Karma

jackieh00
New Member

Thanks but I total still has total2 count, total1 number is 0.

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...