<?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: Replace spaces not working in props.conf SEDCMD in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238962#M71007</link>
    <description>&lt;P&gt;We're going to have to move comments here because we've reached the limit on comments under one question.&lt;/P&gt;

&lt;P&gt;Real quick @jlvix1, is this windows or what?&lt;/P&gt;</description>
    <pubDate>Mon, 22 Aug 2016 15:58:40 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2016-08-22T15:58:40Z</dc:date>
    <item>
      <title>Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238949#M70994</link>
      <description>&lt;P&gt;Hi all, I have tried everything...&lt;/P&gt;

&lt;P&gt;In props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-replacespaces = s/\s/_/g  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and also &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-replacespaces = s/ /_/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried something like s/\s/lol/g and this did not work also, the problem is likely with identifying the single space.&lt;/P&gt;

&lt;P&gt;What I would like to do is perform a find replace for spaces and replace with underscores, as the KV pairs are not being picked up correctly when a space is encountered, for example I have the code in (that works) that performs : SEDCMD-replacecolons = s/\s:\s/=/g s/:\s/=/g s/:\n/=/g t hat puts the equals signs in correctly, I just want to re-go over it and replace spaces with underscores.&lt;/P&gt;

&lt;P&gt;We aren't able to change the code that writes the logs, in case anyone suggests that.&lt;/P&gt;

&lt;P&gt;Can anyone please explain why sedcmd will not work with a single space as either a regex identifier or a raw character?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 11:01:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238949#M70994</guid>
      <dc:creator>jlvix1</dc:creator>
      <dc:date>2016-08-17T11:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238950#M70995</link>
      <description>&lt;P&gt;I don't see an issue with the SEDCMD command. Where are you placing this props.conf? This should go on Indexer/Heavy Forwarder and will only do the replacement for new events (old events will not change).&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 17:07:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238950#M70995</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-18T17:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238951#M70996</link>
      <description>&lt;P&gt;Yes this is in props.conf.  As I stated, replacecolons works fine.  I have re-tried various times on various configurations.  The problem is replacing \s on its own.  Is it working for you?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2016 07:40:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238951#M70996</guid>
      <dc:creator>jlvix1</dc:creator>
      <dc:date>2016-08-19T07:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238952#M70997</link>
      <description>&lt;P&gt;Can you try &lt;CODE&gt;s/\ /_/g&lt;/CODE&gt;? &lt;/P&gt;

&lt;P&gt;That has done trick once for me. &lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2016 12:04:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238952#M70997</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2016-08-19T12:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238953#M70998</link>
      <description>&lt;P&gt;Hi, this does not work, still not bringing in the events, SEDCMD has an issue with this&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2016 12:56:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238953#M70998</guid>
      <dc:creator>jlvix1</dc:creator>
      <dc:date>2016-08-19T12:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238954#M70999</link>
      <description>&lt;P&gt;how about \s+ or putting the sedcmd in quotes?&lt;/P&gt;

&lt;P&gt;Are there spaces when the sedcmd runs?&lt;/P&gt;

&lt;P&gt;example&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;raw = THERE ARE SPACES&lt;BR /&gt;
SEDCMD-AAA = s/THERE\sARE\sSPACES/TEHREARENTSPACES/g&lt;BR /&gt;
SEDCMD-BBB = s/\s/&lt;/EM&gt;/g    &lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2016 14:33:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238954#M70999</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-08-19T14:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238955#M71000</link>
      <description>&lt;P&gt;Are you restarting splunk?  Are you doing this on indexers and forwarders?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2016 14:33:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238955#M71000</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-08-19T14:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238956#M71001</link>
      <description>&lt;P&gt;Hi, yes everything is working otherwise, doing this on heavy forwarder.&lt;/P&gt;

&lt;P&gt;I'm looking at other options now, going to use regex capture groups and just try to scrape what I can.&lt;/P&gt;

&lt;P&gt;My testimony here is that SED in splunk does not work identically to SED in linux.  \s can not be found and replaced with anything in splunk.  When reading up on SED in general, my command should work fine.&lt;/P&gt;

&lt;P&gt;This may of course be a collision between transforms.conf etc...  Or it could just be that there is some method required.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2016 15:14:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238956#M71001</guid>
      <dc:creator>jlvix1</dc:creator>
      <dc:date>2016-08-19T15:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238957#M71002</link>
      <description>&lt;P&gt;I just tried the following from search, which is pretty much a mimic in props without the """&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|gentimes start=-1|eval Space="THIS  IS   A   TEST"|rex mode=sed field=Space "s/( )/^/g" and the output is 

THIS^^IS^^^A^^^TEST
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;One last try may be?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2016 15:29:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238957#M71002</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2016-08-19T15:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238958#M71003</link>
      <description>&lt;P&gt;Hi, I'd imagine that will work here as well, though the search time stuff is a fairly different game to the indexing side?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2016 15:36:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238958#M71003</guid>
      <dc:creator>jlvix1</dc:creator>
      <dc:date>2016-08-19T15:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238959#M71004</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; \s works fine in sedcmd for me
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Aug 2016 16:02:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238959#M71004</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-08-19T16:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238960#M71005</link>
      <description>&lt;P&gt;&lt;CODE&gt;+1&lt;/CODE&gt; to @jkat54 's answer. &lt;/P&gt;

&lt;P&gt;I created a script that writes &lt;CODE&gt;"$Date T O D A Y  I S $DAY"&lt;/CODE&gt; and configured the monitored input. &lt;/P&gt;

&lt;P&gt;Inputs.conf&lt;BR /&gt;
    [monitor:///opt/splunk/bin/scripts/test.txt]&lt;BR /&gt;
    index=main&lt;BR /&gt;
    sourcetype=test&lt;/P&gt;

&lt;P&gt;In props.conf, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/opt/splunk/bin/scripts/test.txt]
SEDCMD-replacespaces = s/()/^/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bounced splunkd and here's the output in search&lt;/P&gt;

&lt;P&gt;index=main sourcetype=test&lt;/P&gt;

&lt;P&gt;Output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^0^8^-^1^9^-^2^0^1^6^ ^T^O^D^A^Y^ ^I^S^ ^M^O^N^D^A^Y^
^0^8^-^1^9^-^2^0^1^6^ ^T^O^D^A^Y^ ^I^S^ ^T^U^E^S^D^A^Y^
^0^8^-^1^9^-^2^0^1^6^ ^T^O^D^A^Y^ ^I^S^ ^W^E^D^N^E^S^D^A^Y^
^0^8^-^1^9^-^2^0^1^6^ ^T^O^D^A^Y^ ^I^S^ ^T^H^U^R^S^D^A^Y^
^0^8^-^1^9^-^2^0^1^6^ ^T^O^D^A^Y^ ^I^S^ ^F^R^I^D^A^Y^
^0^8^-^1^9^-^2^0^1^6^ ^T^O^D^A^Y^ ^I^S^ ^S^A^T^U^R^D^A^Y^
^0^8^-^1^9^-^2^0^1^6^ ^T^O^D^A^Y^ ^I^S^ ^S^U^N^D^A^Y
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I ran out of suggestions as all the proposed formats work for me.&lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2016 16:16:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238960#M71005</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2016-08-19T16:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238961#M71006</link>
      <description>&lt;P&gt;Thanks for that, slightly different to \s:&lt;/P&gt;

&lt;P&gt;SEDCMD-replacespaces = s/()/^/g&lt;/P&gt;

&lt;P&gt;I will give that a shot!&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2016 07:39:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238961#M71006</guid>
      <dc:creator>jlvix1</dc:creator>
      <dc:date>2016-08-22T07:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238962#M71007</link>
      <description>&lt;P&gt;We're going to have to move comments here because we've reached the limit on comments under one question.&lt;/P&gt;

&lt;P&gt;Real quick @jlvix1, is this windows or what?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2016 15:58:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238962#M71007</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-08-22T15:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Replace spaces not working in props.conf SEDCMD</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238963#M71008</link>
      <description>&lt;P&gt;Yes windows, 7 and 2012 I have tried this on.  It's just a bit hacky that SEDCMD-replacespaces = s/()/^/g means to replace any character with ^ and including spaces.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2016 07:42:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-spaces-not-working-in-props-conf-SEDCMD/m-p/238963#M71008</guid>
      <dc:creator>jlvix1</dc:creator>
      <dc:date>2016-08-23T07:42:15Z</dc:date>
    </item>
  </channel>
</rss>

