<?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: Extract field with rex in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-field-with-rex/m-p/627381#M15126</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/93662"&gt;@altink&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you looking for this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval raw="[CLIENT: 192.20.21.22]"
| rename raw as _raw 
|rename comment as "upto this is sample data" 
| rex field=_raw "\[CLIENT:(?&amp;lt;IP2&amp;gt;.*)\]"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jan 2023 18:28:32 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2023-01-17T18:28:32Z</dc:date>
    <item>
      <title>How to extract field with rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-field-with-rex/m-p/627377#M15123</link>
      <description>&lt;P&gt;Dear All.&lt;BR /&gt;&lt;BR /&gt;When searching some database log as&lt;BR /&gt;index=my_db ....&lt;BR /&gt;I have a field named "statement"&amp;nbsp; with content as example below:&lt;BR /&gt;&lt;BR /&gt;The login packet used to open the connection is structurally invalid; the connection has been closed. Please contact the vendor of the client library. [CLIENT: 192.20.21.22]&lt;BR /&gt;&lt;BR /&gt;I need to create a new field, named IP2, with the IP address as above.&lt;BR /&gt;&lt;BR /&gt;In general, the rex command must look for the text between&amp;nbsp; "[CLIENT: " and "]"&lt;BR /&gt;&lt;BR /&gt;Your help is appreciated&lt;BR /&gt;&lt;BR /&gt;best regards&lt;BR /&gt;Altin&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 20:19:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-field-with-rex/m-p/627377#M15123</guid>
      <dc:creator>altink</dc:creator>
      <dc:date>2023-01-17T20:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field with rex</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-field-with-rex/m-p/627381#M15126</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/93662"&gt;@altink&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you looking for this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval raw="[CLIENT: 192.20.21.22]"
| rename raw as _raw 
|rename comment as "upto this is sample data" 
| rex field=_raw "\[CLIENT:(?&amp;lt;IP2&amp;gt;.*)\]"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 18:28:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-field-with-rex/m-p/627381#M15126</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2023-01-17T18:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field with rex</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-field-with-rex/m-p/627384#M15127</link>
      <description>&lt;P&gt;I am not getting:&lt;BR /&gt;&lt;BR /&gt;Why makeresults should be there&lt;BR /&gt;I have an existing field "statement" from which I need to get the IP, instead of a _raw one&lt;BR /&gt;Do not understand part "rename comment .." - I have no field named "comment"&lt;BR /&gt;&lt;BR /&gt;referring to part&lt;BR /&gt;&amp;nbsp;eval raw="[CLIENT: 192.20.21.22]"&lt;BR /&gt;&lt;BR /&gt;part 192.20.21.22 is NOT fixed,&amp;nbsp; it is just from the example above, it is variable - what I want to get as field IP2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Altin&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 18:40:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-field-with-rex/m-p/627384#M15127</guid>
      <dc:creator>altink</dc:creator>
      <dc:date>2023-01-17T18:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field with rex</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-field-with-rex/m-p/627406#M15130</link>
      <description>&lt;P&gt;When people reply with solutions they will often post a block of code starting with | makeresults, which means this is an example which you can copy/paste to a Splunk search window and run to demonstrate the solution.&lt;/P&gt;&lt;P&gt;If you do that, you will see that it will create a dummy example and then extract a new field called IP2 with the address as need. The "rename..." is simply telling you that up to the final line, is an example setting up a solution for you.&lt;/P&gt;&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;has shown, the last line is the rex statement you need.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 02:22:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-field-with-rex/m-p/627406#M15130</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-01-18T02:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field with rex</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-field-with-rex/m-p/627494#M15139</link>
      <description>&lt;P&gt;Thank you for your answer too&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;BR /&gt;Altin&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 16:51:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-field-with-rex/m-p/627494#M15139</guid>
      <dc:creator>altink</dc:creator>
      <dc:date>2023-01-18T16:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extract field with rex</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-field-with-rex/m-p/627496#M15140</link>
      <description>&lt;P&gt;Thank you very much for the solution&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Altin&lt;BR /&gt;&lt;BR /&gt;ps. upvote is "accept as solution"?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 16:55:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-field-with-rex/m-p/627496#M15140</guid>
      <dc:creator>altink</dc:creator>
      <dc:date>2023-01-18T16:55:29Z</dc:date>
    </item>
  </channel>
</rss>

