<?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: Extracting id field from one event and looking for this id in another event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314288#M94067</link>
    <description>&lt;P&gt;My bad. I misread/misunderstood the logs. Kindly provide the guidance for my recent posted query.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Sep 2017 13:18:05 GMT</pubDate>
    <dc:creator>kdulhan</dc:creator>
    <dc:date>2017-09-01T13:18:05Z</dc:date>
    <item>
      <title>Extracting id field from one event and looking for this id in another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314283#M94062</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have the below two event logs:&lt;BR /&gt;
Event1:&lt;BR /&gt;
ns=app1, id=12,Error='400', Service='CallGetAccount'&lt;/P&gt;

&lt;P&gt;Event2:&lt;BR /&gt;
ns=app1, id=12,', Service='CallGetRetro', Account='12345'&lt;/P&gt;

&lt;P&gt;Now I have the below Search query =&amp;gt;&lt;/P&gt;

&lt;P&gt;ns=app1  Error='400' &lt;BR /&gt;
Above gives me the Event 1 where I have an error code of 400.&lt;/P&gt;

&lt;P&gt;Kindly let me know how to fetch id from Event 1 and then search Event 2 with that id and if found, add 1 to Output field 1 and  if not found, add 1 to Output field 2 and get the count displayed in table format .&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 13:35:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314283#M94062</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-08-31T13:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting id field from one event and looking for this id in another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314284#M94063</link>
      <description>&lt;P&gt;Perhaps this will help get you started.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ns=app1 | transaction id startswith=eval(Error='400') | eval OutputField1=if(eventcount==2, 1, 0), OutputField2=if(eventcount==1, 1, 0) | stats sum(OutputField1) as OutputField1 sum(OutputField2) as OutputField2 | table OutputField2 OutputField2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Aug 2017 15:47:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314284#M94063</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-08-31T15:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting id field from one event and looking for this id in another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314285#M94064</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;

&lt;P&gt;Event1:&lt;BR /&gt;
ns=app1, id=12, [ErrorResponse] Service='CallGetAccount'&lt;/P&gt;

&lt;P&gt;Event2:&lt;BR /&gt;
ns=app1, id=12,', Service='CallGetRetro', Account='12345'&lt;/P&gt;

&lt;P&gt;Now I have the below Search query =&amp;gt;&lt;/P&gt;

&lt;P&gt;ns=app1 ErrorResponse &lt;BR /&gt;
Above gives me the Event 1 where I have an error.&lt;/P&gt;

&lt;P&gt;Kindly let me know how to fetch id from Event 1 i.e. id=12 and then search Event 2 with that id and if found, add 1 to Output field 1 and if not found, add 1 to Output field 2 and get the count displayed in table format .&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 16:13:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314285#M94064</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-08-31T16:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting id field from one event and looking for this id in another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314286#M94065</link>
      <description>&lt;P&gt;In order to search for the error records, I use :&lt;BR /&gt;
ns=app1 Service='trigger1' Id!='temp-100' | Search ErrorResponse&lt;/P&gt;

&lt;P&gt;Here I get an event like:&lt;BR /&gt;
timestamp ns=app1 [ErrorResponse] Service='trigger1' id=105 ActNo=1234&lt;/P&gt;

&lt;P&gt;Now I have to fetch this ActNo field and search with only ActNo=1234. It will list many events and in those I have to look for a field appId = 'New1'. If New1, I have to add it to a counter1 else counter2.&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 10:26:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314286#M94065</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-09-01T10:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting id field from one event and looking for this id in another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314287#M94066</link>
      <description>&lt;P&gt;That is different from your original question.  It's difficult to provide an answer when the question changes.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 13:12:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314287#M94066</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-09-01T13:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting id field from one event and looking for this id in another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314288#M94067</link>
      <description>&lt;P&gt;My bad. I misread/misunderstood the logs. Kindly provide the guidance for my recent posted query.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 13:18:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314288#M94067</guid>
      <dc:creator>kdulhan</dc:creator>
      <dc:date>2017-09-01T13:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting id field from one event and looking for this id in another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314289#M94068</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ns=app1 [ns=app1 Error='400'  | table id]
| stats count BY id
| search count&amp;gt;1
| stats count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Sep 2017 06:27:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314289#M94068</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-09-03T06:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting id field from one event and looking for this id in another event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314290#M94069</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ns=app1 appId=* [ns=app1 Service='trigger1' Id!='temp-100' | Search ErrorResponse | return ActNo]
| stats sum(eval(appId=='New1')) as counter1 sum(eval(appId!='New1')) as counter2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Sep 2017 12:56:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-id-field-from-one-event-and-looking-for-this-id-in/m-p/314290#M94069</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-09-06T12:56:16Z</dc:date>
    </item>
  </channel>
</rss>

