<?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 How to match two lines by a common ID within the same file and extract a field from the second line? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-lines-by-a-common-ID-within-the-same-file-and/m-p/156331#M43962</link>
    <description>&lt;P&gt;How can I match 2 lines of the same file that have a random number of other lines between them?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1111 Start Sub Transaction. New Id 1115
other lines here 
1115 Transaction End. No Funds Available
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to match them on ID = 1115 and extract the result (in this case "No Funds Available").&lt;BR /&gt;
Thank you.&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jun 2015 10:29:33 GMT</pubDate>
    <dc:creator>achetreanu</dc:creator>
    <dc:date>2015-06-15T10:29:33Z</dc:date>
    <item>
      <title>How to match two lines by a common ID within the same file and extract a field from the second line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-lines-by-a-common-ID-within-the-same-file-and/m-p/156331#M43962</link>
      <description>&lt;P&gt;How can I match 2 lines of the same file that have a random number of other lines between them?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1111 Start Sub Transaction. New Id 1115
other lines here 
1115 Transaction End. No Funds Available
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to match them on ID = 1115 and extract the result (in this case "No Funds Available").&lt;BR /&gt;
Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2015 10:29:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-lines-by-a-common-ID-within-the-same-file-and/m-p/156331#M43962</guid>
      <dc:creator>achetreanu</dc:creator>
      <dc:date>2015-06-15T10:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two lines by a common ID within the same file and extract a field from the second line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-lines-by-a-common-ID-within-the-same-file-and/m-p/156332#M43963</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "^(?&amp;lt;firstWord&amp;gt;\w+).*(?&amp;lt;lastWord&amp;gt;\w+)$" | eval ID=if(isnumber(lastWord), lastWord, firstWord) | stats list(_raw) by ID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Jun 2015 13:08:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-lines-by-a-common-ID-within-the-same-file-and/m-p/156332#M43963</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-15T13:08:02Z</dc:date>
    </item>
  </channel>
</rss>

