<?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 do I remove \x00 characters from my log message? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94017#M24229</link>
    <description>&lt;P&gt;It is best to not post additional questions in the answer section. Post them as a question so they get proper visibility.&lt;/P&gt;

&lt;P&gt;/g means globally - it will replace every instance of the subject that it finds, not just the first one.&lt;/P&gt;

&lt;P&gt;s/-//g would swap app dash with nothing. but if you did s/-// with no g, you would end up with xxxxxx-xxxx.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2016 14:43:10 GMT</pubDate>
    <dc:creator>Jason</dc:creator>
    <dc:date>2016-08-03T14:43:10Z</dc:date>
    <item>
      <title>How do I remove \x00 characters from my log message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94010#M24222</link>
      <description>&lt;P&gt;I have a log message which (thanks, M$) has been littered with &lt;CODE&gt;\x00&lt;/CODE&gt; text - originally null bytes. They appear every other character, making it almost impossible to read. Can Splunk automatically remove these for me?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 13:35:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94010#M24222</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2013-04-15T13:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove \x00 characters from my log message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94011#M24223</link>
      <description>&lt;P&gt;Yes, Splunk can. You can use SEDCMD- to rewrite the events to remove the &lt;CODE&gt;\x00&lt;/CODE&gt;s, which by the time the data hits an indexer are already the text "\x00" - they're no longer the null byte.&lt;/P&gt;

&lt;P&gt;On the search bar: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex mode=sed "s/\\\\x00//g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Automatically at parsing ("indexing") time for any new data, in props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
SEDCMD-remove_nulls = s/\\x00//g
LINE_BREAKER = ((?:[\r\n](?:\\x00)?)+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Special LINE_BREAKER was added because Splunk was interpreting the null bytes between \r and \n (the two halves of the Windows newline, in the file I was working on) as additional lines and adding them to the event. It says use "&lt;CODE&gt;(one newline character optionally followed by the text \ x 0 0) one or more times&lt;/CODE&gt;" as the breaker (thrown away) between events.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 13:47:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94011#M24223</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2013-04-15T13:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove \x00 characters from my log message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94012#M24224</link>
      <description>&lt;P&gt;This sounds like a character encoding problem to me.&lt;/P&gt;

&lt;P&gt;If the log is encoded as UTF-16, only contains UTF-8 and is being read as UTF-8, then there'll be extra \x00 between each character.&lt;/P&gt;

&lt;P&gt;Find out what character encoding the messages use, then set the &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/Data/Configurecharactersetencoding"&gt;charset in splunk&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 13:53:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94012#M24224</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2013-04-15T13:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove \x00 characters from my log message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94013#M24225</link>
      <description>&lt;P&gt;Have a look at SEDCMD -  &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/Admin/Propsconf"&gt; Admin Manual - Props.conf &lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Adding this to your props.conf should work: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;SEDCMD-StripNULL= s/\x00//g&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 13:54:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94013#M24225</guid>
      <dc:creator>JSapienza</dc:creator>
      <dc:date>2013-04-15T13:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove \x00 characters from my log message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94014#M24226</link>
      <description>&lt;P&gt;I tried the UTF-16LE as mentioned &lt;A href="http://splunk-base.splunk.com/answers/24484/sql-server-errorlog"&gt;here&lt;/A&gt; but it did not work. But now that I think about it, I might have put the config on the indexer, not the universal forwarder. Oops. Config below still works when put on the indexer.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2013 09:17:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94014#M24226</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2013-04-24T09:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove \x00 characters from my log message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94015#M24227</link>
      <description>&lt;P&gt;this helped me out.  thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Nov 2013 04:21:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94015#M24227</guid>
      <dc:creator>saccam447</dc:creator>
      <dc:date>2013-11-30T04:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove \x00 characters from my log message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94016#M24228</link>
      <description>&lt;P&gt;What is the /g part? What if I just wanted to delete the characters and/or just swap them w/ nothing?&lt;/P&gt;

&lt;P&gt;xxx-xxx-xxxx is now xxxxxxxxxx&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2016 19:38:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94016#M24228</guid>
      <dc:creator>clintla</dc:creator>
      <dc:date>2016-08-02T19:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove \x00 characters from my log message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94017#M24229</link>
      <description>&lt;P&gt;It is best to not post additional questions in the answer section. Post them as a question so they get proper visibility.&lt;/P&gt;

&lt;P&gt;/g means globally - it will replace every instance of the subject that it finds, not just the first one.&lt;/P&gt;

&lt;P&gt;s/-//g would swap app dash with nothing. but if you did s/-// with no g, you would end up with xxxxxx-xxxx.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2016 14:43:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-x00-characters-from-my-log-message/m-p/94017#M24229</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2016-08-03T14:43:10Z</dc:date>
    </item>
  </channel>
</rss>

