<?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: Combine two events which has unique field and get difference between those two events in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599829#M13893</link>
    <description>&lt;P&gt;You need to go back a step - do you have a field called log? If not, you could do your rex against the _raw field (which is the default if no field is specified)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "eventName=...&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 31 May 2022 08:00:49 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-05-31T08:00:49Z</dc:date>
    <item>
      <title>Combine two events which has unique field and get difference between those two events</title>
      <link>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599798#M13887</link>
      <description>&lt;P&gt;Hi All, I haven3 events in splunk where there is one unique field in all the three events.&lt;BR /&gt;Here is the example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE width="1195"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="1195"&gt;&lt;P&gt;[2022-05-10 23:17:23,049] [INFO ] [] [c.c.n.t.e.i.T.JmsMessageEventData] [] - channel="NPP_MPIR.CHANNEL", productVersion="1.3.1-0-1-404089bc7", uuid="3c78031b-12b3-4694-ab88-3a265bf8499e", eventDateTime="2022-05-10T23:17:23.049Z", severity="INFO", code="JmsMessageEventData", component="mq.listener", category="default", serviceName="Mandated Payment Initiation", &lt;STRONG&gt;eventName="MANDATED_PAYMENT_INITIATION.SERVICE_START",&lt;/STRONG&gt; message="Mandated Payment Initiation Event", entityType="MSG", start="1652188643002", &lt;STRONG&gt;messageIdentification="CTBAAUSNXXX20220510020220510131721"&lt;/STRONG&gt;, queueManagerName="PGT201", queueManagerHostname="10.39.9.38",&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Initial: [2022-05-10 23:17:24,425] [INFO ] [] [c.c.n.t.e.i.T.JmsMessageEventData] [] -&amp;nbsp; eventDateTime="2022-05-10T23:17:24.425Z", severity="INFO", code="JmsMessageEventData", component="submission.sent", category="default", serviceName="Submission Service", eventName="PAYMENT_STATUS_REPORT.SENT", &lt;STRONG&gt;message="Customer initial status report sent to PAG"&lt;/STRONG&gt;, entityType="INSTR", externalSystem="PAG", start="1652188644418", stop="1652188644425", elapsed="7", exceptionInfo="null", &lt;STRONG&gt;messageIdentification="CTBAAUSNXXX20220510020220510131721"&lt;/STRONG&gt;, firstMessageTraceIdentification="2TDyn8AlRMud1mfUA49o6A"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Final: [2022-05-10 23:17:30,528] [INFO ] [] [c.c.n.t.e.i.T.JmsMessageEventData] [] -&amp;nbsp; eventDateTime="2022-05-10T23:17:30.528Z", severity="INFO", code="JmsMessageEventData", component="submission.sent", category="default", serviceName="Submission Service", eventName="PAYMENT_STATUS_REPORT.SENT", &lt;STRONG&gt;message="Customer final status report sent to PAG"&lt;/STRONG&gt;, entityType="INSTR", externalSystem="PAG", start="1652188650520", stop="1652188650528", elapsed="8", exceptionInfo="null", &lt;STRONG&gt;messageIdentification="CTBAAUSNXXX20220510020220510131721",&lt;/STRONG&gt; firstMessageTraceIdentification="2TDyn8AlRMud1mfUA49o6A",&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;These are the 3 events with unique field "&lt;STRONG&gt;messageIdentification",&amp;nbsp; I need to combine 1 and 2 events and also 1 and 3 and get difference of time between them and calculate how much percentage of events are triggering in less than 15 sec and 30 sec.&lt;BR /&gt;&lt;BR /&gt;I tried using transaction command but not able to fetch ..i think i am using it wrong.&lt;BR /&gt;&lt;BR /&gt;Can anyone help me on the same.&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 31 May 2022 06:14:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599798#M13887</guid>
      <dc:creator>vineela</dc:creator>
      <dc:date>2022-05-31T06:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two events which has unique field and get difference between those two events</title>
      <link>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599802#M13888</link>
      <description>&lt;P&gt;Assuming the fields have already been extracted&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval eventStart=if(eventName="MANDATED_PAYMENT_INITIATION.SERVICE_START",_time,null())
| eventstats values(eventStart) as eventStart by messageIdentification
| eval initialTimeDiff=if(message="Customer initial status report sent to PAG", _time-eventStart, null())
| eval finalTimeDiff=if(message="Customer final status report sent to PAG", _time-eventStart, null())
| stats values(initialTimeDiff) as initialTimeDiff values(finalTimeDiff) as finalTimeDiff by messageIdentification&lt;/LI-CODE&gt;&lt;P&gt;This will get you the time differences - I am not sure what you are looking in terms of percentages and the two boundaries - for example, do you mean percentage of initial differences less than 15 and percentage of final differences less than 30 or percentages of both being less than 15 and both being less than 30?&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 06:46:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599802#M13888</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-31T06:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two events which has unique field and get difference between those two events</title>
      <link>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599817#M13889</link>
      <description>&lt;P&gt;You can do a single huge ugly stats with evals but it's prettier to go with a solution similar to what &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt; 's started with. More or less something like this (assuming that you have one value per "type" of event):&lt;/P&gt;&lt;PRE&gt;&amp;lt;&amp;lt;your search&amp;gt;&amp;gt;&lt;BR /&gt;| eval starttime=if(eventName="MANDATED_PAYMENT_INITIATION.SERVICE_START",_time,null())&lt;BR /&gt;| eval initialtime=if(message="Customer initial status report sent to PAG",_time,null())&lt;BR /&gt;| eval finaltime=if(message="Customer final status report sent to PAG",_time,null())&lt;BR /&gt;| stats values(starttime) as starttime values(initialtime) as initialtime values(finaltime) as finaltime by messageIdentification&lt;BR /&gt;| eval initialduration=initialtime-starttime&lt;BR /&gt;| eval finalduration=finaltime-starttime&lt;/PRE&gt;&lt;P&gt;This way you have your duration times and can do aggregate summaries like counting and calculating percentages and so on.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 07:26:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599817#M13889</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-05-31T07:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two events which has unique field and get difference between those two events</title>
      <link>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599820#M13890</link>
      <description>&lt;P&gt;Hi Both,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Thanks for your response.&lt;BR /&gt;&lt;BR /&gt;But i am not able to get any results.&lt;/P&gt;&lt;P&gt;please find screenshot for reference.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vineela_0-1653982405561.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19867i4661140026400155/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vineela_0-1653982405561.png" alt="vineela_0-1653982405561.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 07:34:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599820#M13890</guid>
      <dc:creator>vineela</dc:creator>
      <dc:date>2022-05-31T07:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two events which has unique field and get difference between those two events</title>
      <link>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599823#M13891</link>
      <description>&lt;P&gt;Remove "stats count by eventName" - this is limiting the events to just two fields (count and eventName)&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 07:42:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599823#M13891</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-31T07:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two events which has unique field and get difference between those two events</title>
      <link>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599827#M13892</link>
      <description>&lt;P&gt;Still no luck&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vineela_1-1653983456602.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19868i464F9F437FCA493C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vineela_1-1653983456602.png" alt="vineela_1-1653983456602.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 07:51:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599827#M13892</guid>
      <dc:creator>vineela</dc:creator>
      <dc:date>2022-05-31T07:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two events which has unique field and get difference between those two events</title>
      <link>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599829#M13893</link>
      <description>&lt;P&gt;You need to go back a step - do you have a field called log? If not, you could do your rex against the _raw field (which is the default if no field is specified)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "eventName=...&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 31 May 2022 08:00:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/599829#M13893</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-31T08:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two events which has unique field and get difference between those two events</title>
      <link>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/600377#M13910</link>
      <description>&lt;P&gt;Hi Whisper,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Yes,i have log in my event and now am able to fetch events.and calculate time as well. But not able to calculate the initial percentage and final percentage as well. Can you please help me on the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 04:14:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/600377#M13910</guid>
      <dc:creator>vineela</dc:creator>
      <dc:date>2022-06-03T04:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two events which has unique field and get difference between those two events</title>
      <link>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/600383#M13911</link>
      <description>&lt;P&gt;What do you currently have? Please share the code in a code block &amp;lt;/&amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 05:28:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Combine-two-events-which-has-unique-field-and-get-difference/m-p/600383#M13911</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-03T05:28:05Z</dc:date>
    </item>
  </channel>
</rss>

