<?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 do I extract the latest occurrence of a field from multiple lines? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-the-latest-occurrence-of-a-field-from-multiple/m-p/405722#M117285</link>
    <description>&lt;P&gt;Want to capture the latest occurrence of "working_condition_check - status -" which is "Stopped". &lt;/P&gt;

&lt;P&gt;Please help me in getting the regex.&lt;/P&gt;

&lt;P&gt;Below is the log message.&lt;/P&gt;

&lt;P&gt;10/01/2018 15:01:04 Server_Name&lt;BR /&gt;
working_condition_check - status - Started&lt;BR /&gt;
working_condition_check - status - Running&lt;BR /&gt;
working_condition_check - status - Stopped&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 21:29:07 GMT</pubDate>
    <dc:creator>nkchaitanya</dc:creator>
    <dc:date>2020-09-29T21:29:07Z</dc:date>
    <item>
      <title>How do I extract the latest occurrence of a field from multiple lines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-the-latest-occurrence-of-a-field-from-multiple/m-p/405722#M117285</link>
      <description>&lt;P&gt;Want to capture the latest occurrence of "working_condition_check - status -" which is "Stopped". &lt;/P&gt;

&lt;P&gt;Please help me in getting the regex.&lt;/P&gt;

&lt;P&gt;Below is the log message.&lt;/P&gt;

&lt;P&gt;10/01/2018 15:01:04 Server_Name&lt;BR /&gt;
working_condition_check - status - Started&lt;BR /&gt;
working_condition_check - status - Running&lt;BR /&gt;
working_condition_check - status - Stopped&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:29:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-the-latest-occurrence-of-a-field-from-multiple/m-p/405722#M117285</guid>
      <dc:creator>nkchaitanya</dc:creator>
      <dc:date>2020-09-29T21:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract the latest occurrence of a field from multiple lines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-the-latest-occurrence-of-a-field-from-multiple/m-p/405723#M117286</link>
      <description>&lt;P&gt;Hi @nkchaitanya,&lt;BR /&gt;
Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|rex ".*status - (?&amp;lt;status&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Oct 2018 10:35:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-the-latest-occurrence-of-a-field-from-multiple/m-p/405723#M117286</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-10-03T10:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract the latest occurrence of a field from multiple lines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-the-latest-occurrence-of-a-field-from-multiple/m-p/405724#M117287</link>
      <description>&lt;P&gt;hi @nkchaitanya &lt;/P&gt;

&lt;P&gt;As @493669 answer follow that end of your query add this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults |eval hari="working_condition_check - status - Stopped" |rex field=hari ".*status - (?&amp;lt;status&amp;gt;\w+)" |where status="Stopped"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Oct 2018 10:51:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-the-latest-occurrence-of-a-field-from-multiple/m-p/405724#M117287</guid>
      <dc:creator>harishalipaka</dc:creator>
      <dc:date>2018-10-03T10:51:56Z</dc:date>
    </item>
  </channel>
</rss>

