<?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 can I remove colons in a field value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336906#M99957</link>
    <description>&lt;P&gt;Wow, Thank you very much DalJeanis. &lt;BR /&gt;
You have been a great help to me.&lt;BR /&gt;
Thanks again.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Mar 2017 23:23:22 GMT</pubDate>
    <dc:creator>superhm</dc:creator>
    <dc:date>2017-03-06T23:23:22Z</dc:date>
    <item>
      <title>How can I remove colons in a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336900#M99951</link>
      <description>&lt;P&gt;Hi there, &lt;/P&gt;

&lt;P&gt;I wanna remove colons in a field value like a MAC Address.&lt;/P&gt;

&lt;P&gt;I have a field MAC like mac="E8:11:32:31:33:BA", but I want to remove colons to get mac="E811323133BA"&lt;/P&gt;

&lt;P&gt;How can I do it?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 09:08:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336900#M99951</guid>
      <dc:creator>superhm</dc:creator>
      <dc:date>2017-03-06T09:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove colons in a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336901#M99952</link>
      <description>&lt;P&gt;I think the replace command should help.. try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| replace "*:*" with "**" in [FIELDNAME]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Mar 2017 13:44:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336901#M99952</guid>
      <dc:creator>MOberschelp</dc:creator>
      <dc:date>2017-03-06T13:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove colons in a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336902#M99953</link>
      <description>&lt;P&gt;Try &lt;CODE&gt;eval mac=replace (mac,":","")&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 13:55:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336902#M99953</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-03-06T13:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove colons in a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336903#M99954</link>
      <description>&lt;P&gt;This method would only work for the first colon.  See the test results in my answer.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 15:23:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336903#M99954</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-06T15:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove colons in a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336904#M99955</link>
      <description>&lt;P&gt;I'd use rex in mode=sed (see newmac3 code below).  richgalloway's method (newmac1 code below) also works.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval mac="E8:11:32:31:33:BA" 
| eval newmac1=mac, newmac2=mac, newmac3=mac
| eval newmac1=replace (newmac1,":","")
| replace "*:*" with "**" in newmac2
| rex field=newmac3 mode=sed "s/://g" 
| table mac, newmac1, newmac2, newmac3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...results in...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mac                newmac1       newmac2           newmac3           
E8:11:32:31:33:BA  E811323133BA  E811:32:31:33:BA  E811323133BA  
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Mar 2017 15:30:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336904#M99955</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-06T15:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove colons in a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336905#M99956</link>
      <description>&lt;P&gt;Thank you richgalloway. it works that I want.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 23:16:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336905#M99956</guid>
      <dc:creator>superhm</dc:creator>
      <dc:date>2017-03-06T23:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove colons in a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336906#M99957</link>
      <description>&lt;P&gt;Wow, Thank you very much DalJeanis. &lt;BR /&gt;
You have been a great help to me.&lt;BR /&gt;
Thanks again.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 23:23:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336906#M99957</guid>
      <dc:creator>superhm</dc:creator>
      <dc:date>2017-03-06T23:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove colons in a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336907#M99958</link>
      <description>&lt;P&gt;Thank you for your comment.&lt;BR /&gt;
It work for the first colon. : )&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 23:28:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336907#M99958</guid>
      <dc:creator>superhm</dc:creator>
      <dc:date>2017-03-06T23:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove colons in a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336908#M99959</link>
      <description>&lt;P&gt;Please make sure and upvote the helpful ones that work!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 00:50:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336908#M99959</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-07T00:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove colons in a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336909#M99960</link>
      <description>&lt;P&gt;I downvoted this post because doesnt eloquently answer the question. not that it doesnt answer the question... just the only thing they needed was:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval newmac1=replace (mac,":","")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Oct 2017 21:26:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336909#M99960</guid>
      <dc:creator>jtrujillo</dc:creator>
      <dc:date>2017-10-03T21:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove colons in a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336910#M99961</link>
      <description>&lt;P&gt;@jtrujillo - Please reread my answer. Only line 6 in mine is &lt;STRONG&gt;needed&lt;/STRONG&gt;, which is why my answer starts off with  "I'd use rex in mode=sed (see newmac3 code below)." &lt;/P&gt;

&lt;P&gt;I may occasionally use a few more words than other people, but when I do it's usually intended to teach. The rest is there to demonstrate that the &lt;CODE&gt;rex mode=sed&lt;/CODE&gt; and the &lt;CODE&gt;replace&lt;/CODE&gt; method (that you liked) both work, using run-anywhere code that anyone can run to verify for themselves, and also posting the output from the entire search.  &lt;/P&gt;

&lt;P&gt;Line 4 demonstrates that @richgalloway's method works correctly.&lt;BR /&gt;
Line 5 demonstrates that @MOberschelp's method only removes the first colon.&lt;BR /&gt;
Line 6 demonstrates that my way works correctly.&lt;/P&gt;

&lt;P&gt;Please also read the comment on my answer by the original poster.  &lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 12:16:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-colons-in-a-field-value/m-p/336910#M99961</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-04T12:16:51Z</dc:date>
    </item>
  </channel>
</rss>

