<?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: Compare events &amp;quot;without&amp;quot; common fields in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612568#M105992</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243764"&gt;@mkouzou&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;how can you distinguish initial alert from the recovery?&lt;/P&gt;&lt;P&gt;I suppose that there's a string or a field different in the two events, so if they have a different value for a field (called e.g. status) like status=initial and status=recovery, you could try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index (status="initial" OR status="recovery")
| eval EID=if(status="initial",eid,init_eid)
| stats dc(status) AS status_count BY EID
| where status_count=1&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Sep 2022 12:41:04 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-09-09T12:41:04Z</dc:date>
    <item>
      <title>How to compare events "without" common fields?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612564#M105991</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I'm trying since 3 days now to find a solution for my problem but without success.&lt;BR /&gt;I look around for solutions and already asked questions but I didn't find (or I missed it) any.&lt;/P&gt;&lt;P&gt;I have a monitoring tool that sends me the host problems in splunk in json format.&lt;/P&gt;&lt;P&gt;Once the alert/problem ended, the tool send me another message in splunk but with very little informations except of one field that contains a value(alert id) of the initial alert.&lt;BR /&gt;&lt;BR /&gt;Here a example:&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Initial alert:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;{"timestamp":1662715948,"guid":468431423,"result":1,"&lt;STRONG&gt;eid&lt;/STRONG&gt;":1580,"name":"test kouzou","sev":3,"h":[{"host":"toto","name":"toto"}],"team":["titi"],"tags":-[{"tag":"App","value":"System"},{"tag":"App","value":"host-up"}]}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Recovery:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;{"timestamp":1662716608,"guid":604699994,"result":0,"eid":1059134005,"&lt;STRONG&gt;init_eid&lt;/STRONG&gt;":1580}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The idea is, to make searches for alerts that have not been resolved yet and show them in a dashboard, if the alert has been acknowledged by the tool, I don't want to show it .I'm trying to make equivalency with the&amp;nbsp;"init_eid" and "eid" field but without success.&lt;/P&gt;&lt;P&gt;It is a json content and I tried to do some manual extractions in order to guarantee the "normality" of the fields.I realized also that the "transactions" command is not working at all, only for one field.&amp;nbsp;Do you have any ideas on how I could achieve this goal?&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 17:02:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612564#M105991</guid>
      <dc:creator>mkouzou</dc:creator>
      <dc:date>2022-09-09T17:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Compare events "without" common fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612568#M105992</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243764"&gt;@mkouzou&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;how can you distinguish initial alert from the recovery?&lt;/P&gt;&lt;P&gt;I suppose that there's a string or a field different in the two events, so if they have a different value for a field (called e.g. status) like status=initial and status=recovery, you could try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index (status="initial" OR status="recovery")
| eval EID=if(status="initial",eid,init_eid)
| stats dc(status) AS status_count BY EID
| where status_count=1&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 12:41:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612568#M105992</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-09T12:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Compare events "without" common fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612571#M105993</link>
      <description>&lt;P&gt;hello&amp;nbsp;gcusello and thank you for your quick reply,&lt;/P&gt;&lt;P&gt;The "result" field changes from value "1" to value zero "0) when the problem resolved.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 12:48:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612571#M105993</guid>
      <dc:creator>mkouzou</dc:creator>
      <dc:date>2022-09-09T12:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Compare events "without" common fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612572#M105994</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243764"&gt;@mkouzou&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;In this case:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index (result="1" OR result="0")
| eval EID=if(result="1",eid,init_eid)
| stats dc(result) AS result_count values(result) AS result BY EID
| where result_count=1 AND result="1"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 12:51:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612572#M105994</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-09T12:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Compare events "without" common fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612577#M105995</link>
      <description>&lt;P&gt;&lt;SPAN&gt;hello&amp;nbsp;gcusello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I think that your SPL is not ok.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The result shows me always the history of the alerts.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The idea is to hide the alerts that have been resolved(result=0).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We should search for an event with "result=1", take its "eid" and search for an event containing the "init_eid" which has for sure the "result=0".&lt;BR /&gt;&lt;BR /&gt;I thought that I could do that with "transaction" command but it si not working(no results).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 13:20:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612577#M105995</guid>
      <dc:creator>mkouzou</dc:creator>
      <dc:date>2022-09-09T13:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Compare events "without" common fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612578#M105996</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243764"&gt;@mkouzou&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;with my search you have as results all the events where for an eid result=1 and there isn't any result=0.&lt;/P&gt;&lt;P&gt;If I correctly understand this is your requirement.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 13:27:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612578#M105996</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-09T13:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Compare events "without" common fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612579#M105997</link>
      <description>&lt;P&gt;&lt;SPAN&gt;hello&amp;nbsp;gcusello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I need all the events that they never received a "result=0" message, that is to say, only the active alerts with result=1 and not those that have been acknowledged.&lt;/P&gt;&lt;P&gt;For your information ,the "init_eid" and "eid" are uniques codes. We have the "eid" once the alerte triggered and the "init_eid" once the alert resolved.&lt;/P&gt;&lt;P&gt;The "init_eid"&amp;nbsp; contains the parent's ID ("eid").&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 13:36:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612579#M105997</guid>
      <dc:creator>mkouzou</dc:creator>
      <dc:date>2022-09-09T13:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Compare events "without" common fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612634#M106002</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243764"&gt;@mkouzou&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;using this search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index (result="1" OR result="0")
| eval EID=if(result="1",eid,init_eid)
| stats dc(result) AS result_count values(result) AS result BY EID
| where result_count=1 AND result="1"&lt;/LI-CODE&gt;&lt;P&gt;you correlate events wih result=1 (eid) with result=0 (init_eid) using the EID field to exclude the ones with both the messages (the where condition).&lt;/P&gt;&lt;P&gt;The logis is:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;filter only the events with result=0 or result=1,&lt;/LI&gt;&lt;LI&gt;correlate&amp;nbsp;events wih result=1 (eid) with result=0 (init_eid) using the EID field,&lt;/LI&gt;&lt;LI&gt;filtering at the end&amp;nbsp;the ones with both the messages (the where condition),&lt;/LI&gt;&lt;LI&gt;in this way only the eid with only result=1 remains as result.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If I correctly understood, this is your requirement, what's the problem?&lt;/P&gt;&lt;P&gt;Do you want to find something different?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 05:28:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612634#M106002</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-10T05:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Compare events "without" common fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612709#M106008</link>
      <description>&lt;P&gt;&lt;SPAN&gt;hello&amp;nbsp;gcusello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you once again for your help.&lt;/P&gt;&lt;P&gt;The "problem" with your search is that is not correlating both events with same "eid &amp;amp; initi_eid" so splunk finds always "result"1.&lt;BR /&gt;I want to be able even if I chose "all time" in the time picker, to show only events that are not resolved, that is to say, that the we cannot find the couple of "eid and init_eid" (init_eid is the acknowledge event).&lt;BR /&gt;&lt;BR /&gt;I don't see how your search combines these two events...:(&lt;/P&gt;&lt;P&gt;As I said, I tried the "transaction command" but it doesn't work...Is there any perquisites (type of data, etc) in order that the command works correctly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 09:04:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612709#M106008</guid>
      <dc:creator>mkouzou</dc:creator>
      <dc:date>2022-09-12T09:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Compare events "without" common fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612711#M106009</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243764"&gt;@mkouzou&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;in my search the EID field contains the values for correlation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;eid if result=1&lt;/LI&gt;&lt;LI&gt;orig_eid if&amp;nbsp; result=0&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;In this way running a stats command By EID you group and correlate the events for each EID.&lt;/P&gt;&lt;P&gt;Then with the following filter, you take only the ones with result=1, because you discard the ones with both the results and (if present) the ones with result=0.&lt;/P&gt;&lt;P&gt;If I correctly understood this is your goal: display all the eids (contained in the EID field) with only result=1 and not also result=0.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 09:20:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612711#M106009</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-12T09:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare events "without" common fields?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612716#M106010</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243764"&gt;@mkouzou&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;search gives the active/unresolved EID values, I wanted to contribute with the below search that will show you full unresolved alerts _raw.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index 
    [ search index=test sourcetype=test2 
    | eval eid=coalesce(init_eid,eid) 
    | stats latest(result) as latest_result by eid 
    | search latest_result!=0 
    | fields eid 
    | format]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 10:15:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612716#M106010</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2022-09-12T10:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare events "without" common fields?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612884#M106042</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;scelikok,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You have correctly understood my need.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, this search is a little bit slow, especially when we run it for the last 7 days &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I finally found the solution by doing that and optimizing the result by adding some more filters like severity:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=my_index sourcetype=alerts  (eid=* AND result="1" AND severity&amp;gt;2 AND error=*) OR (init_eid=* AND result="0")
|fields result,init_eid,eid,Host,severity,error
|eval Merged_eid=coalesce(init_eid,eid)
|eval resolved=if(isnull(init_eid),"No","Yes")
|stats max(Host) as Host min(_time) as _time  max(error) as Alert max(resolved) as Resolved max(severity) as Severity by Merged_eid
|search Severity&amp;gt;2 AND Resolved="No"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 12:54:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612884#M106042</guid>
      <dc:creator>mkouzou</dc:creator>
      <dc:date>2022-09-13T12:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare events "without" common fields?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612886#M106043</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I finally found the solution by doing that and optimizing the result by adding some more filters like severity:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=my_index sourcetype=alerts  (eid=* AND result="1" AND severity&amp;gt;2 AND error=*) OR (init_eid=* AND result="0")
|fields result,init_eid,eid,Host,severity,error
|eval Merged_eid=coalesce(init_eid,eid)
|eval resolved=if(isnull(init_eid),"No","Yes")
|stats max(Host) as Host min(_time) as _time  max(error) as Alert max(resolved) as Resolved max(severity) as Severity by Merged_eid
|search Severity&amp;gt;2 AND Resolved="No"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a great day.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 12:56:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-events-quot-without-quot-common-fields/m-p/612886#M106043</guid>
      <dc:creator>mkouzou</dc:creator>
      <dc:date>2022-09-13T12:56:23Z</dc:date>
    </item>
  </channel>
</rss>

