<?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: Strip control/color codes in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47726#M9028</link>
    <description>&lt;P&gt;Huge thumbs up, been at this all day!! Thanks!&lt;/P&gt;</description>
    <pubDate>Sat, 21 Oct 2017 22:06:58 GMT</pubDate>
    <dc:creator>sogeniusio</dc:creator>
    <dc:date>2017-10-21T22:06:58Z</dc:date>
    <item>
      <title>Strip control/color codes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47721#M9023</link>
      <description>&lt;P&gt;I have log files with color codes and control characters that we'd like to strip because they clutter the search results.  In a few cases, we've just removed them from the file with the commands found at &lt;A href="http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed"&gt;http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;It used to be a one off case, but now it is the standard case.  It seems there is some global setting I might be missing.  Or is this something that I would have to use a transform for?&lt;/P&gt;

&lt;P&gt;EDIT&lt;/P&gt;

&lt;P&gt;So based on &lt;A href="http://www.splunk.com/base/Documentation/4.1.4/Admin/Configurecharactersetencoding"&gt;http://www.splunk.com/base/Documentation/4.1.4/Admin/Configurecharactersetencoding&lt;/A&gt;&lt;BR /&gt;
which says "Splunk escapes the invalid characters as hex values (for example: "\xF3")."&lt;/P&gt;

&lt;P&gt;It appears my file encoding was set wrong.  Is there a way to just tell splunk to ignore the characters?  &lt;/P&gt;</description>
      <pubDate>Sun, 24 Jul 2011 22:14:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47721#M9023</guid>
      <dc:creator>oreoshake</dc:creator>
      <dc:date>2011-07-24T22:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Strip control/color codes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47722#M9024</link>
      <description>&lt;P&gt;You can use the SEDCMD directive in &lt;CODE&gt;props.conf&lt;/CODE&gt; for this.&lt;/P&gt;

&lt;P&gt;For instance, let's call the sourcetype you want this to apply to "colorlogs". In props.conf, specify this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[colorlogs]
SEDCMD-removecolorcodes = s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After restarting Splunk, all color codes should be removed from any events of sourcetype "colorlogs" added to the index in the future.&lt;/P&gt;

&lt;P&gt;(note: the regex itself is just the same as the one in the link you supplied, I'm taking their word for that it's actually effective in removing color codes &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; )&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2011 06:28:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47722#M9024</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-07-25T06:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Strip control/color codes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47723#M9025</link>
      <description>&lt;P&gt;Thanks Ayn, makes sense.  I put this in apps/search/local/props.conf but the existing data isn't clean.  Is that an index or search time deal? &lt;/P&gt;

&lt;P&gt;Am I missing a transform?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 19:10:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47723#M9025</guid>
      <dc:creator>xplodersuv</dc:creator>
      <dc:date>2011-07-26T19:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Strip control/color codes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47724#M9026</link>
      <description>&lt;P&gt;Actually nevermind, it works!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 19:17:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47724#M9026</guid>
      <dc:creator>xplodersuv</dc:creator>
      <dc:date>2011-07-26T19:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Strip control/color codes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47725#M9027</link>
      <description>&lt;P&gt;Great! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Could you please mark the answer as accepted? That way others see that the question has an accepted solution.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 21:19:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47725#M9027</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-07-26T21:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Strip control/color codes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47726#M9028</link>
      <description>&lt;P&gt;Huge thumbs up, been at this all day!! Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 22:06:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47726#M9028</guid>
      <dc:creator>sogeniusio</dc:creator>
      <dc:date>2017-10-21T22:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Strip control/color codes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47727#M9029</link>
      <description>&lt;P&gt;greetings from 2020. still working to this day. Now relevant with kubernetes logging. &lt;/P&gt;

&lt;P&gt;thanks for all the wisdom over the years @Ayn&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 15:53:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/47727#M9029</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2020-01-29T15:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Strip control/color codes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/555340#M91983</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;The SEDCMD is done at index time bevore the events are stored. The stored events have the color codes stripped off.&lt;/P&gt;&lt;P&gt;Maybe there is also a problem with the order of commands. When I changed the sourcetype and deleted the color codes, I had to put the SEDCMD in props.conf before the REPORT... to change the sourcetype.&lt;/P&gt;&lt;P&gt;It would be helpful to have the possibility to remove color codes included directly in splunk.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 16:16:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/555340#M91983</guid>
      <dc:creator>cssmdi</dc:creator>
      <dc:date>2021-06-10T16:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Strip control/color codes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/694317#M115369</link>
      <description>&lt;P&gt;I know it's an old post, but it helped me , but it leaves `&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN class=""&gt;m` behind, which is 'Reset' I believe&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 17:48:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/694317#M115369</guid>
      <dc:creator>vchepkov</dc:creator>
      <dc:date>2024-07-25T17:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Strip control/color codes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/694320#M115370</link>
      <description>&lt;P&gt;I just added additional&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SEDCMD-removereset=s/\x1B\[0;m//g&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 18:05:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Strip-control-color-codes/m-p/694320#M115370</guid>
      <dc:creator>vchepkov</dc:creator>
      <dc:date>2024-07-25T18:05:41Z</dc:date>
    </item>
  </channel>
</rss>

