Splunk Search

How to combine two queries along with eventstats

rkishoreqa
Communicator

Hi , 

Based on your suggestion I prepared queries for two different apps as below.  Now I need to combine these two and get a single stats table.

Stats table like as : 

jId  Applname       diff   ASNumber - StNumber -  count

xy     app1              23        983723                                   2
uw    app2             98                                377813            1

Query 1:
|rex field=_raw "ApplicationName:\s+\[(?P<Applname>.*)];"
|rex field=_raw "jobId: (?<jId>\w+);"
|rex field=_raw "\<ASNumber\>(?<ASNumber>[^\<]+)\<[^\<]"
|eventstats count(jId) as jIdcount by ASNumber
|where jIdcount > 1
|stats range(_time) as diff, first(ASNumber) as ASNumber, count(ASNumber) as count by jId,Applname

Query 2:
|rex field=_raw "ApplicationName:\s+\[(?P<Applname>.*)];" 
|rex field=_raw "jobId: (?<jId>\w+);"
|rex field=_raw "StNumber\":\"(?P<StNumber>.[^\"\,\"]*)"
|eventstats count(jId) as jIdcount by StNumber
|where jIdcount > 1
|stats range(_time) as diff, first(StNumber) as StNumber,count(StNumber) as count by jId,Applname

Labels (1)
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...