<?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: How to edit regex for existing fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-regex-for-existing-fields/m-p/391886#M114084</link>
    <description>&lt;P&gt;The &lt;CODE&gt;regex&lt;/CODE&gt; command is a search filtering command, not a field creating/parsing command.  You need to use &lt;CODE&gt;rex&lt;/CODE&gt; for that.&lt;/P&gt;</description>
    <pubDate>Mon, 27 May 2019 21:46:02 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-05-27T21:46:02Z</dc:date>
    <item>
      <title>How to edit regex for existing fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-regex-for-existing-fields/m-p/391883#M114081</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;
need to edit existing fields using regex as its not giving proper values.&lt;BR /&gt;
e.g. there is field called "IP" (auto extracted ) its have IP address with some other values. so need to remove extra values apart from ip address.&lt;BR /&gt;
Please suggest. &lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2019 09:26:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-regex-for-existing-fields/m-p/391883#M114081</guid>
      <dc:creator>jas0049</dc:creator>
      <dc:date>2019-05-27T09:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit regex for existing fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-regex-for-existing-fields/m-p/391884#M114082</link>
      <description>&lt;P&gt;You can always use the &lt;CODE&gt;rex&lt;/CODE&gt; command to create/modify a field that is always extracted. For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval IP="10.0.0.1:9997"
| rex field=IP "(?&amp;lt;myIP&amp;gt;[\d.]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will result in &lt;CODE&gt;myIP&lt;/CODE&gt; containing just the IP, and not the port from the &lt;CODE&gt;IP&lt;/CODE&gt; field.&lt;/P&gt;

&lt;P&gt;For future reference, it is always best to give some example data with your question so that it is easier to help answer you particular problem.&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2019 13:18:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-regex-for-existing-fields/m-p/391884#M114082</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2019-05-27T13:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit regex for existing fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-regex-for-existing-fields/m-p/391885#M114083</link>
      <description>&lt;P&gt;Splunk can do it easily during search time. Please find regex for various &lt;A href="https://www.oreilly.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html"&gt;IP address types&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | makeresults
 | eval mixedIP="10.0.0.1:8000"
 | rex field=mixedIP "(?&amp;lt;ipv4&amp;gt;(?:[0-9]{1,3}\.){3}[0-9]{1,3})"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;..&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2019 14:21:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-regex-for-existing-fields/m-p/391885#M114083</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-27T14:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit regex for existing fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-regex-for-existing-fields/m-p/391886#M114084</link>
      <description>&lt;P&gt;The &lt;CODE&gt;regex&lt;/CODE&gt; command is a search filtering command, not a field creating/parsing command.  You need to use &lt;CODE&gt;rex&lt;/CODE&gt; for that.&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2019 21:46:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-regex-for-existing-fields/m-p/391886#M114084</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-05-27T21:46:02Z</dc:date>
    </item>
  </channel>
</rss>

