<?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 extract field from sentence? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-field-from-sentence/m-p/132054#M10839</link>
    <description>&lt;P&gt;I'm trying to write a field extraction to get the number of hung threads on a WebSphere application server. The log statement looks something like:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;[6/15/14 11:07:37:103 CDT] 00000003 ThreadMonitor W   WSVR0605W: Thread "WebContainer : 21" (000000a3) has been active for 729415 milliseconds and may be hung.  There is/are 3 thread(s) in total in the server that may be hung.&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;I want to key in on the following section: &lt;EM&gt;There is/are **3&lt;/EM&gt;* thread(s)*&lt;/P&gt;

&lt;P&gt;If I pipe search results into the rex, the value is successfully extracted into a field called hung_thread_count:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search criteria&amp;gt; | rex field=_raw \sThere is\/are \(?&amp;lt;hung_thread_count&amp;gt;.*?\) thread"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, when I manually enter the regex into the interactive field explorer no matches are found when I hit the "test" button...do I have to enter something specific to extract this value into a field?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 17:37:59 GMT</pubDate>
    <dc:creator>sjnorman</dc:creator>
    <dc:date>2020-09-28T17:37:59Z</dc:date>
    <item>
      <title>How to extract field from sentence?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-field-from-sentence/m-p/132054#M10839</link>
      <description>&lt;P&gt;I'm trying to write a field extraction to get the number of hung threads on a WebSphere application server. The log statement looks something like:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;[6/15/14 11:07:37:103 CDT] 00000003 ThreadMonitor W   WSVR0605W: Thread "WebContainer : 21" (000000a3) has been active for 729415 milliseconds and may be hung.  There is/are 3 thread(s) in total in the server that may be hung.&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;I want to key in on the following section: &lt;EM&gt;There is/are **3&lt;/EM&gt;* thread(s)*&lt;/P&gt;

&lt;P&gt;If I pipe search results into the rex, the value is successfully extracted into a field called hung_thread_count:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search criteria&amp;gt; | rex field=_raw \sThere is\/are \(?&amp;lt;hung_thread_count&amp;gt;.*?\) thread"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, when I manually enter the regex into the interactive field explorer no matches are found when I hit the "test" button...do I have to enter something specific to extract this value into a field?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:37:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-field-from-sentence/m-p/132054#M10839</guid>
      <dc:creator>sjnorman</dc:creator>
      <dc:date>2020-09-28T17:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract field from sentence?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-field-from-sentence/m-p/132055#M10840</link>
      <description>&lt;P&gt;you are missing double quoted and they are too many escape characters in the regex, especially on the matching parenthesis.&lt;/P&gt;

&lt;P&gt;try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=_raw "There is\/are (?&amp;lt;hung_thread_count&amp;gt;\d+) thread"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Sep 2014 14:11:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-field-from-sentence/m-p/132055#M10840</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2014-09-19T14:11:54Z</dc:date>
    </item>
  </channel>
</rss>

