<?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: REX for Multilined event + extract where line where match is found in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257697#M176880</link>
    <description>&lt;P&gt;not related to this question, but, something strange related to "answers.splunk.com"...&lt;BR /&gt;
this post was created only 4 days back, but it says 2k views for this post. &lt;BR /&gt;
the similar posts created on the same day are having only 70 or 80 or 100 views !!!&lt;/P&gt;</description>
    <pubDate>Tue, 06 Sep 2016 15:40:33 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2016-09-06T15:40:33Z</dc:date>
    <item>
      <title>REX for Multilined event + extract where line where match is found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257690#M176873</link>
      <description>&lt;P&gt;My splunk system is reading in logs as mutli lined events which is by design. So 1 event could have 300 lines or so.&lt;/P&gt;

&lt;P&gt;Here is an extract from that long log file of 3 HDDs 1 of which is faulty. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;15.5 : DRACKA    z159_BHIFIJFOKFO xx01 5538.5GB 512B/sect (P78J4Dk)
15.6 : DRACKA    z159_BHIFIJFOKFO xx01 6538.5GB 512B/sect (Failed)
15.7 : DRACKA    z159_BHIFIJFOKFO xx01 6538.5GB 512B/sect (PJ5F4Dk)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need a REX that will extract to a field ONLY the middle line. The REX will be used in field extractor. &lt;/P&gt;

&lt;P&gt;Extracted field could be called "failed_disk_error" and the result would be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;15.6 : DRACKA    z159_BHIFIJFOKFO xx01 6538.5GB 512B/sect (Failed)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:49:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257690#M176873</guid>
      <dc:creator>arrowecssupport</dc:creator>
      <dc:date>2020-09-29T10:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: REX for Multilined event + extract where line where match is found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257691#M176874</link>
      <description>&lt;P&gt;try this&lt;/P&gt;

&lt;P&gt;\n*(?.&lt;EM&gt;Failed))\n&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;you can test it on &lt;A href="https://regex101.com/" target="_blank"&gt;https://regex101.com/&lt;/A&gt;&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:52:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257691#M176874</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-29T10:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: REX for Multilined event + extract where line where match is found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257692#M176875</link>
      <description>&lt;P&gt;If i run it under field extractor it doesn't show anything up.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 11:18:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257692#M176875</guid>
      <dc:creator>arrowecssupport</dc:creator>
      <dc:date>2016-09-02T11:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: REX for Multilined event + extract where line where match is found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257693#M176876</link>
      <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?m)[\n]+(?&amp;lt;failed_disk_error&amp;gt;.*\(Failed\))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Sep 2016 11:57:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257693#M176876</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-02T11:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: REX for Multilined event + extract where line where match is found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257694#M176877</link>
      <description>&lt;P&gt;sorry but there was a mistake copying the regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\n*(?&amp;lt;myfield&amp;gt;.*Failed\))\n*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 12:28:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257694#M176877</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-09-02T12:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: REX for Multilined event + extract where line where match is found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257695#M176878</link>
      <description>&lt;P&gt;Getting the issue where we get all lines up to the match.&lt;BR /&gt;
So not just getting the 1 line i want but loads more.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 16:09:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257695#M176878</guid>
      <dc:creator>arrowecssupport</dc:creator>
      <dc:date>2016-09-02T16:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: REX for Multilined event + extract where line where match is found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257696#M176879</link>
      <description>&lt;P&gt;To have more than one line you have to add /g at the end of the regex.&lt;BR /&gt;
You can try it on  &lt;A href="https://regex101.com/"&gt;https://regex101.com/&lt;/A&gt;&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Sun, 04 Sep 2016 07:05:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257696#M176879</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-09-04T07:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: REX for Multilined event + extract where line where match is found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257697#M176880</link>
      <description>&lt;P&gt;not related to this question, but, something strange related to "answers.splunk.com"...&lt;BR /&gt;
this post was created only 4 days back, but it says 2k views for this post. &lt;BR /&gt;
the similar posts created on the same day are having only 70 or 80 or 100 views !!!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 15:40:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257697#M176880</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-09-06T15:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: REX for Multilined event + extract where line where match is found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257698#M176881</link>
      <description>&lt;P&gt;if you're satisfied of the answer, please, accept the answer.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 11:15:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257698#M176881</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-09-09T11:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: REX for Multilined event + extract where line where match is found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257699#M176882</link>
      <description>&lt;P&gt;(?-s)(?^.&lt;EM&gt;(Failed).&lt;/EM&gt;$)&lt;/P&gt;

&lt;P&gt;This was the final REX that gave me exactly what i wanted. &lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 15:42:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257699#M176882</guid>
      <dc:creator>arrowecssupport</dc:creator>
      <dc:date>2016-09-13T15:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: REX for Multilined event + extract where line where match is found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257700#M176883</link>
      <description>&lt;P&gt;Sorry it didn't resolve my issue. Thank you for you time on this.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 15:43:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-for-Multilined-event-extract-where-line-where-match-is-found/m-p/257700#M176883</guid>
      <dc:creator>arrowecssupport</dc:creator>
      <dc:date>2016-09-13T15:43:23Z</dc:date>
    </item>
  </channel>
</rss>

