<?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: How can we extract transaction id from an event and do a search to display all events having that transaction ID? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-extract-transaction-id-from-an-event-and-do-a-search/m-p/342200#M101393</link>
    <description>&lt;P&gt;Try this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=baz    [ index=baz  "Internal Server Error" transactionID=* | stats by transactionID]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The stuff in braces, because of an implicit &lt;CODE&gt;format&lt;/CODE&gt; command, translates to...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  ( transactionID="Value1" OR  transactionID="Value2" OR ...)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If nothing comes back from the braces, it comes out as... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NOT ()
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...which is valid but will return no results. &lt;/P&gt;</description>
    <pubDate>Wed, 02 Aug 2017 22:53:12 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-08-02T22:53:12Z</dc:date>
    <item>
      <title>How can we extract transaction id from an event and do a search to display all events having that transaction ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-extract-transaction-id-from-an-event-and-do-a-search/m-p/342199#M101392</link>
      <description>&lt;P&gt;I am fairly new to Splunk queries.&lt;/P&gt;

&lt;P&gt;I have below mentioned logs:&lt;/P&gt;

&lt;P&gt;INFO  [HTTP-120]: 2017-08-02T18:00:03,157 - transactionID=12345 - "Internal Server Error"&lt;BR /&gt;
INFO  [HTTP-120]: 2017-08-02T18:00:02,110 - transactionID=12345 - "Foo"&lt;BR /&gt;
INFO  [HTTP-120]: 2017-08-02T18:00:01,100 - transactionID=12345 - "Bar"&lt;/P&gt;

&lt;P&gt;INFO  [HTTP-120]: 2017-08-02T18:00:03,157 - transactionID=45678 - "Success"&lt;BR /&gt;
INFO  [HTTP-120]: 2017-08-02T18:00:02,110 - transactionID=45678 - "Foo"&lt;BR /&gt;
INFO  [HTTP-120]: 2017-08-02T18:00:01,100 - transactionID=45678 - "Bar"&lt;/P&gt;

&lt;P&gt;I need to search for events which has "Internal Server Error" then extract the transactionID and do a new search to print all the events which has that transactionID.&lt;BR /&gt;
So my output should be &lt;BR /&gt;
INFO  [HTTP-120]: 2017-08-02T18:00:03,157 - transactionID=12345 - "Internal Server Error"&lt;BR /&gt;
INFO  [HTTP-120]: 2017-08-02T18:00:02,110 - transactionID=12345 - "Foo"&lt;BR /&gt;
INFO  [HTTP-120]: 2017-08-02T18:00:01,100 - transactionID=12345 - "Bar"&lt;/P&gt;

&lt;P&gt;The query should not fail if there are no events. I used subquery to return transactionID for base query, but for 0 events it failed saying Comparator '=' has missing right side value.&lt;/P&gt;

&lt;P&gt;Any help  is much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 21:20:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-extract-transaction-id-from-an-event-and-do-a-search/m-p/342199#M101392</guid>
      <dc:creator>diliphg</dc:creator>
      <dc:date>2017-08-02T21:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can we extract transaction id from an event and do a search to display all events having that transaction ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-extract-transaction-id-from-an-event-and-do-a-search/m-p/342200#M101393</link>
      <description>&lt;P&gt;Try this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=baz    [ index=baz  "Internal Server Error" transactionID=* | stats by transactionID]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The stuff in braces, because of an implicit &lt;CODE&gt;format&lt;/CODE&gt; command, translates to...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  ( transactionID="Value1" OR  transactionID="Value2" OR ...)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If nothing comes back from the braces, it comes out as... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NOT ()
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...which is valid but will return no results. &lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 22:53:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-extract-transaction-id-from-an-event-and-do-a-search/m-p/342200#M101393</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-02T22:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can we extract transaction id from an event and do a search to display all events having that transaction ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-extract-transaction-id-from-an-event-and-do-a-search/m-p/342201#M101394</link>
      <description>&lt;P&gt;Still doesn't work.&lt;/P&gt;

&lt;P&gt;This query gives the stats "index=baz  "Internal Server Error" transactionID=* | stats by transactionID".&lt;/P&gt;

&lt;P&gt;But this whole query  index=baz  [search  index=baz  "Internal Server Error" transactionID=* | stats by transactionID] says 0 events found.&lt;/P&gt;

&lt;P&gt;Since i am new please help if there are any silly mistakes.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 03:12:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-extract-transaction-id-from-an-event-and-do-a-search/m-p/342201#M101394</guid>
      <dc:creator>diliphg</dc:creator>
      <dc:date>2017-08-03T03:12:48Z</dc:date>
    </item>
  </channel>
</rss>

