<?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 to extract a field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rex-to-extract-a-field/m-p/353789#M104709</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can you please try &lt;CODE&gt;&amp;lt;yourBasesearch&amp;gt; | rex ".*,\s(?&amp;lt;status&amp;gt;.*)"&lt;/CODE&gt;, this will extract &lt;CODE&gt;connection attempt failed&lt;/CODE&gt; in new field called &lt;CODE&gt;status&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Dec 2017 12:41:21 GMT</pubDate>
    <dc:creator>harsmarvania57</dc:creator>
    <dc:date>2017-12-20T12:41:21Z</dc:date>
    <item>
      <title>rex to extract a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-to-extract-a-field/m-p/353788#M104708</link>
      <description>&lt;P&gt;How do I extract   connection attempt failed from the below log &lt;/P&gt;

&lt;P&gt;2017-12-20T07:51:05.847Z I REPL     [ReplicationExecutor] Error in heartbeat request to 10.78.33.13:8191; Location18915 Failed attempt to connect to 10.78.33.13:8191; couldn't connect to server 10.78.33.13:8191 (10.78.33.13), connection attempt failed&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 08:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-to-extract-a-field/m-p/353788#M104708</guid>
      <dc:creator>Mohsin123</dc:creator>
      <dc:date>2017-12-20T08:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: rex to extract a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-to-extract-a-field/m-p/353789#M104709</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can you please try &lt;CODE&gt;&amp;lt;yourBasesearch&amp;gt; | rex ".*,\s(?&amp;lt;status&amp;gt;.*)"&lt;/CODE&gt;, this will extract &lt;CODE&gt;connection attempt failed&lt;/CODE&gt; in new field called &lt;CODE&gt;status&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 12:41:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-to-extract-a-field/m-p/353789#M104709</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2017-12-20T12:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: rex to extract a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-to-extract-a-field/m-p/353790#M104710</link>
      <description>&lt;P&gt;Hi shraddhamuduli,&lt;BR /&gt;
which information do you want to extract?&lt;BR /&gt;
if you want to extract the message "connection attempt failed", it's easy&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex ".*\),(?&amp;lt;my_field&amp;gt;.*)$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if you want to extract other fields (e.g. server and port failed), it's &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex ".*server\s(?&amp;lt;ip&amp;gt;\d+\.\d+\.\d+\.\d+):(?&amp;lt;port&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 12:41:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-to-extract-a-field/m-p/353790#M104710</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-12-20T12:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: rex to extract a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-to-extract-a-field/m-p/353791#M104711</link>
      <description>&lt;P&gt;try this:&lt;BR /&gt;
&lt;CODE&gt;(?&amp;lt;err_message&amp;gt;Error.+;).+,(?&amp;lt;err_reason&amp;gt;.+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;It will extract two fields - err_message and err_reason&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:23:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-to-extract-a-field/m-p/353791#M104711</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2020-09-29T17:23:16Z</dc:date>
    </item>
  </channel>
</rss>

