<?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 remove everything after a colon in an existing field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-everything-after-a-colon-in-an-existing-field/m-p/250934#M74961</link>
    <description>&lt;P&gt;Hi, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| rex mode=sed field=fieldName "s/\:\d+//g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 16 May 2016 14:06:36 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2016-05-16T14:06:36Z</dc:date>
    <item>
      <title>How to remove everything after a colon in an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-everything-after-a-colon-in-an-existing-field/m-p/250933#M74960</link>
      <description>&lt;P&gt;I have a field that contains both IP address and port number separated by a semicolon (example 10.1.1.1:23) How do I use rex to trim off the port# leaving me with just the IP address?&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 12:46:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-everything-after-a-colon-in-an-existing-field/m-p/250933#M74960</guid>
      <dc:creator>kennyja</dc:creator>
      <dc:date>2016-05-16T12:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove everything after a colon in an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-everything-after-a-colon-in-an-existing-field/m-p/250934#M74961</link>
      <description>&lt;P&gt;Hi, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| rex mode=sed field=fieldName "s/\:\d+//g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 May 2016 14:06:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-everything-after-a-colon-in-an-existing-field/m-p/250934#M74961</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-05-16T14:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove everything after a colon in an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-everything-after-a-colon-in-an-existing-field/m-p/250935#M74962</link>
      <description>&lt;P&gt;if you're wanting to replace the field value, @jkat54 solution should work. Howeverm if you only want to extract the IP into a field, try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... | rex field=_raw "(?&amp;lt;ip&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This rex will extract all IP address in a field called ip.&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 14:16:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-everything-after-a-colon-in-an-existing-field/m-p/250935#M74962</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-05-16T14:16:05Z</dc:date>
    </item>
  </channel>
</rss>

