<?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 trim away the port and use only URL after &amp;quot;:&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-away-the-port-and-use-only-URL-after-quot-quot/m-p/373844#M162945</link>
    <description>&lt;P&gt;hey try this run anywhere search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="abc.net:9090 abc.bb23.org:8081" 
| makemv data 
| mvexpand data 
| rex field=data "^(?P&amp;lt;URL&amp;gt;[^\:]+)\:"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In your environment, you should write &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your_base_search&amp;gt; | rex field=&amp;lt;field_name&amp;gt;  "^(?P&amp;lt;URL&amp;gt;[^\:]+)\:"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
    <pubDate>Tue, 13 Feb 2018 06:26:24 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2018-02-13T06:26:24Z</dc:date>
    <item>
      <title>How to trim away the port and use only URL after ":"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-away-the-port-and-use-only-URL-after-quot-quot/m-p/373841#M162942</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a field with values URL and port, how to trim away the port and only use URL?&lt;BR /&gt;
For example,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;abc.net:9090
abc.bb23.org:8081
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;required output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;abc.net
abc.bb23.org
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Feb 2018 19:16:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-away-the-port-and-use-only-URL-after-quot-quot/m-p/373841#M162942</guid>
      <dc:creator>kiran331</dc:creator>
      <dc:date>2018-02-12T19:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim away the port and use only URL after ":"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-away-the-port-and-use-only-URL-after-quot-quot/m-p/373842#M162943</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;You want to use a regular expression to complete this.&lt;/P&gt;

&lt;P&gt;If your field is called ipaddr the following code would apply. Replace the word ipaddr with whatever field you have which captures the IP address.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=bar | rex field=ipaddr "(?P&amp;lt;ipaddr&amp;gt;.*):"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This returns everything before the : and places it in the field called ipaddr. &lt;/P&gt;

&lt;P&gt;Let me know if this works.&lt;/P&gt;

&lt;P&gt;Thank you,&lt;BR /&gt;
Supabuck&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 19:44:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-away-the-port-and-use-only-URL-after-quot-quot/m-p/373842#M162943</guid>
      <dc:creator>supabuck</dc:creator>
      <dc:date>2018-02-12T19:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim away the port and use only URL after ":"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-away-the-port-and-use-only-URL-after-quot-quot/m-p/373843#M162944</link>
      <description>&lt;P&gt;One way is with &lt;CODE&gt;rex&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=foo "(?&amp;lt;URL&amp;gt;[^:]+)" | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Feb 2018 19:46:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-away-the-port-and-use-only-URL-after-quot-quot/m-p/373843#M162944</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-02-12T19:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to trim away the port and use only URL after ":"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-away-the-port-and-use-only-URL-after-quot-quot/m-p/373844#M162945</link>
      <description>&lt;P&gt;hey try this run anywhere search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="abc.net:9090 abc.bb23.org:8081" 
| makemv data 
| mvexpand data 
| rex field=data "^(?P&amp;lt;URL&amp;gt;[^\:]+)\:"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In your environment, you should write &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your_base_search&amp;gt; | rex field=&amp;lt;field_name&amp;gt;  "^(?P&amp;lt;URL&amp;gt;[^\:]+)\:"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 06:26:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-away-the-port-and-use-only-URL-after-quot-quot/m-p/373844#M162945</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-02-13T06:26:24Z</dc:date>
    </item>
  </channel>
</rss>

