Deployment Architecture

Use of output from two indexes

aksampat
New Member

Hi,

I need some help with building a query where the output comes from two different indexes.
Index1:
index=A sourcetype=B | eval cpu_used=1-cpu_idle | eval totalcpu = cpu_used*100

Index2:
index=C sourcetype=D timechart count span=1m AS REQ

Now I need to combine these two and do totalcpu/REQ
How to do this?

Thanks,
Amit

Tags (1)
0 Karma

aksampat
New Member

Thank you all

0 Karma

inventsekar
SplunkTrust
SplunkTrust

Hi Aksampat, as you are a new member, thought to remind you - Can you please accept as answer.. maybe an upvote for the unaccepted answer

0 Karma

inventsekar
SplunkTrust
SplunkTrust

Hi Aksampat, as you are a new member, thought to remind you - Can you please accept as answer.. maybe an upvote for the unaccepted answer

0 Karma

inventsekar
SplunkTrust
SplunkTrust

following MuS's great post, lets check this one -

index=A OR index=C sourcetype=B OR sourcetype=D 
| eval cpu_used=1-cpu_idle | eval totalcpu = cpu_used*100 | stats values(count) AS REQ 
| eval result = totalcpu/REQ
0 Karma

MuS
Legend

Hi aksampat,

I will not solve your problem right now, BUT a good starting point is this answer https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-jo... or the awesome March 2016 post on this page http://wiki.splunk.com/Virtual_.conf

Keep pushing and use stats to the limits 😉

Hope this helps ...

cheers, MuS

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...