<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: System failures in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/System-failures/m-p/472565#M8281</link>
    <description>&lt;P&gt;I do n’t know what I want to do, but just the result&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| transaction JOBNAME JOBID keepevicted=1 startswith="*USERID SYSTEM*" endswith="*FAILD*"
| dedup JOBNAME
| eval JOB = substr(JOBNAME,1,2)
| stats count as failures by JOB
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 05 Sep 2019 08:41:44 GMT</pubDate>
    <dc:creator>HiroshiSatoh</dc:creator>
    <dc:date>2019-09-05T08:41:44Z</dc:date>
    <item>
      <title>System failures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/System-failures/m-p/472564#M8280</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;

&lt;P&gt;I am trying to identify the system failure based on the below sample data :-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ABCD    AB1234  USERID SYSTEM   
ABCD    AB1234  XXXXX   
ABCD    AB1234  YYYYY   
ABCD    AB1234  ZZZZZZ  
ABCD    AB1234  FAILD   
ABCD    AB1231  USERID USER1    
ABCD    AB1231  XXXXX   
ABCD    AB1231  YYYYY   
ABCD    AB1231  ZZZZZZ  
ABCD    AB1231  FAILD   
ABEF    AB1235  USERID SYSTEM   
ABEF    AB1235  XXXXX   
ABEF    AB1235  YYYYY   
ABEF    AB1235  ZZZZZZ  
ABEF    AB1235  FAILD   
DEFG    AB1231  USERID SYSTEM   
DEFG    AB1231  XXXXX   
DEFG    AB1231  YYYYY   
DEFG    AB1231  ZZZZZZ  
DEFG    AB1231  FAILD   
DEFG    AB1231  USERID USER2    
DEFG    AB1231  XXXXX   
DEFG    AB1231  YYYYY   
DEFG    AB1231  ZZZZZZ  
DEFG    AB1231  FAILD   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;First column represent JOBNAME, second JOBID and third MSGTXT &lt;/P&gt;

&lt;P&gt;The JOBNAME and JOBID combination is unique for a process. I am trying to get the count on  FAILD for only USERID SYSTEM appearing in MSGTXT field by first two chars of JOBNAME &lt;/P&gt;

&lt;P&gt;I tried using TRANSACTION command as below but it didn't gave me expected results. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=system_data JOBID=* JOBNAME=* 
| transaction JOBNAME JOBID keepevicted=1 startswith="*USERID SYSTEM*" endswith="*FAILD*"  
| eval JOB = substr(JOBNAME,1,2)
| stats values(eventcount) as failures by JOB
| where eventcount&amp;gt;0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am expecting the output to be as&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;AB 2
DE 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please assist. &lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 08:04:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/System-failures/m-p/472564#M8280</guid>
      <dc:creator>rajatsinghbagga</dc:creator>
      <dc:date>2019-09-05T08:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: System failures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/System-failures/m-p/472565#M8281</link>
      <description>&lt;P&gt;I do n’t know what I want to do, but just the result&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| transaction JOBNAME JOBID keepevicted=1 startswith="*USERID SYSTEM*" endswith="*FAILD*"
| dedup JOBNAME
| eval JOB = substr(JOBNAME,1,2)
| stats count as failures by JOB
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Sep 2019 08:41:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/System-failures/m-p/472565#M8281</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2019-09-05T08:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: System failures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/System-failures/m-p/472566#M8282</link>
      <description>&lt;P&gt;Use this instead of transaction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field="JOBNAME" "(?&amp;lt;JOB&amp;gt;^.{2})"
| stats values(JOB) AS JOB values(MSGTXT) AS MSGTXT by JOBNAME JOBID
| search MSGTXT = "USERID SYSTEM" MSGTXT="FAILD"
| stats count by JOB
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When dealing with a lot of data stats will be more performant that transaction. &lt;BR /&gt;
This basically extracts the 1st 2 chars in the job name and creates a field called job. &lt;BR /&gt;
Then I group all the msgtxt by job name and job id giving me something close to what you would get using the transaction. &lt;BR /&gt;
After, I just filter the results to get the user system and the failed message.&lt;BR /&gt;
At to finish it I just stats it again to get the count per job.&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 08:58:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/System-failures/m-p/472566#M8282</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2019-09-05T08:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: System failures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/System-failures/m-p/472567#M8283</link>
      <description>&lt;P&gt;Thanks @diogofgm  , your SPL works like a charm, Thank you very much. But somewhere in my actual data I have a global job which is associated with every actual job and it shares the same JOBID . Because of this i am always getting this global JOB as XX with every instance of actual JOB AB or DE for this example. Since this global job shares the same JOBID as the actual jobs so I issued | dedup JOBID before the last stats command in your SPL. And i am getting the results as &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;AB   2
XX   2
DE   1
XX   2    
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also tried to give | where NOT JOB == "XX"  but then it gives me no results. &lt;BR /&gt;
is there any way i can suppress/hide XX  for the results?? &lt;/P&gt;

&lt;P&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 04:37:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/System-failures/m-p/472567#M8283</guid>
      <dc:creator>rajatsinghbagga</dc:creator>
      <dc:date>2019-09-06T04:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: System failures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/System-failures/m-p/472568#M8284</link>
      <description>&lt;P&gt;Hello @diogofgm  , I was able to figure out that basically the JOBNAME is multivalue filed which contained both the global job XX along with actual jobs AB or DE so i just picked the actual job from the JOBNAME field using mvindex() function and then ran the stats on the actual job . This finally gave me the expected results. &lt;/P&gt;

&lt;P&gt;Thank you very much !!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 06:00:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/System-failures/m-p/472568#M8284</guid>
      <dc:creator>rajatsinghbagga</dc:creator>
      <dc:date>2019-09-06T06:00:44Z</dc:date>
    </item>
  </channel>
</rss>

