<?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 replace characters in logs using SEDCMD in props.conf in Splunk Heavy Forwarder? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-characters-in-logs-using-SEDCMD-in-props-conf-in/m-p/392308#M70068</link>
    <description>&lt;P&gt;Hi @mmodestino_splunk &lt;/P&gt;

&lt;P&gt;Thank you for replying.&lt;BR /&gt;
I now understand class is an identifier that we define ourselves, and may or may not use it anywhere else. For this problem, I do not see that I will need this &lt;STRONG&gt;combined&lt;/STRONG&gt; class anywhere else.&lt;/P&gt;

&lt;P&gt;I will try to further illustrate the problem to chase the root cause.&lt;BR /&gt;
I am using Splunk of version 7.2.1&lt;/P&gt;

&lt;P&gt;Inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[default]
host = hostname
_SYSLOG_ROUTING = devicename

queueSize = 20GB
persistentQueueSize = 30GB
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am trying to catch logs coming in from port 1234. Since the logs are coming in alright, I am assuming that the configuration in Inputs.conf is all good. Or should I use port somewhere in there?&lt;/P&gt;

&lt;P&gt;The logs coming in are multiline and my primary purpose is to stitch the logs by replacing new line characters with "|". However, after failing to do so with multiple configurations, first I am determined to replace alphabets.&lt;/P&gt;

&lt;P&gt;The above configuration is all that I have configured for solaris:ldap in /opt/splunk/etc/system/local. I checked using the btool and there are other fields and values which are used from /opt/splunk/etc/system/default.&lt;/P&gt;

&lt;P&gt;The log sample I have given above is a complete line from a multiline log. It is not the first line of the log though. The complete log looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;time: 20180702100600
dn: uid=xx11111,ou=xxxxxx,ou=xxxxxx,dc=xx,dc=xxxx,dc=xxxx,dc=xxxx,dc=xxx,dc=xx
changetype: modify
replace: pwdFailureTime
-
replace: pwdAccountLockedTime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 07 Jan 2019 06:42:04 GMT</pubDate>
    <dc:creator>kirandhakal25</dc:creator>
    <dc:date>2019-01-07T06:42:04Z</dc:date>
    <item>
      <title>How to replace characters in logs using SEDCMD in props.conf in Splunk Heavy Forwarder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-characters-in-logs-using-SEDCMD-in-props-conf-in/m-p/392306#M70066</link>
      <description>&lt;P&gt;I have a splunk heavy forwarder setup where the logs are not indexed but are forwarded to another device. I am trying to replace some characters in the logs and forward the changed logs to another device. I tried the following configuration without any success.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt; in /opt/splunk/etc/system/local/&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[solaris:ldap]
SEDCMD-combined = s/m/t/g
TRANSFORMS-routing = send_to_syslog
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Log Sample&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;changetype: modify
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am expecting &lt;STRONG&gt;changetype: todify&lt;/STRONG&gt; in the syslog port of the forwarded device. The logs are coming in but without any changes.&lt;BR /&gt;
I checked for related questions, but most questions have been answered in reference to indexers and not forwarders, so would also like to know if SEDCMD actually works for forwarders without indexers.&lt;/P&gt;

&lt;P&gt;In addition, in the above configuration, I am not sure what &lt;STRONG&gt;combined&lt;/STRONG&gt; in line &lt;STRONG&gt;SEDCMD-combined&lt;/STRONG&gt; does as I could not find a proper definition of that particular field in the documentation. I looked for other examples and copied it from there. Could anyone answer my questions and help me solve my problem?&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jan 2019 04:03:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-characters-in-logs-using-SEDCMD-in-props-conf-in/m-p/392306#M70066</guid>
      <dc:creator>kirandhakal25</dc:creator>
      <dc:date>2019-01-05T04:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace characters in logs using SEDCMD in props.conf in Splunk Heavy Forwarder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-characters-in-logs-using-SEDCMD-in-props-conf-in/m-p/392307#M70067</link>
      <description>&lt;P&gt;Hey kirandhakal25!&lt;/P&gt;

&lt;P&gt;in  your &lt;CODE&gt;SEDCMD-combined&lt;/CODE&gt;, &lt;CODE&gt;combined&lt;/CODE&gt; is a &lt;CODE&gt;class&lt;/CODE&gt; or in other words, an identifier. It can be whatever you like.  It is helpful to describe what the SEDCMD is trying to achieve, ie. &lt;CODE&gt;SEDCMD-modifyLDAPsyslog&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; SEDCMD-&amp;lt;class&amp;gt; = &amp;lt;sed script&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.3/Admin/Propsconf"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.3/Admin/Propsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;As for why your events are not being modified..based on &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.3/Forwarding/Forwarddatatothird-partysystemsd#Syslog_data"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.3/Forwarding/Forwarddatatothird-partysystemsd#Syslog_data&lt;/A&gt; it should work, as it specifically calls out the example of removing new lines from wineventlogs before sending and points to &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.3/Data/Anonymizedata#Anonymize_data_through_a_sed_script"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.3/Data/Anonymizedata#Anonymize_data_through_a_sed_script&lt;/A&gt;, which I assume you have reviewed. &lt;/P&gt;

&lt;P&gt;So let's jump into chasing the root cause!&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;what version of Splunk your HF?&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Just good to know what version we are dealing with. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;What does the inputs.conf look like for this data? Is it a file monitor, or are you catching syslog on a port? etc?&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;This helps trace how this data enters the Splunk pipeline.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;What does the full props.conf for &lt;CODE&gt;solaris:ldap&lt;/CODE&gt; look like? Are these the only parameters being set for this sourcetype?&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;you can check with &lt;CODE&gt;./splunk btool props list solaris:ldap --debug&lt;/CODE&gt; to see the full config. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Is that sample event really representative of your data??&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;In troubleshooting this, it is key to provide exact data (anonymized of course). Is this truly the data you are working with? and does a single event really look like that?&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jan 2019 15:31:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-characters-in-logs-using-SEDCMD-in-props-conf-in/m-p/392307#M70067</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2019-01-05T15:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace characters in logs using SEDCMD in props.conf in Splunk Heavy Forwarder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-characters-in-logs-using-SEDCMD-in-props-conf-in/m-p/392308#M70068</link>
      <description>&lt;P&gt;Hi @mmodestino_splunk &lt;/P&gt;

&lt;P&gt;Thank you for replying.&lt;BR /&gt;
I now understand class is an identifier that we define ourselves, and may or may not use it anywhere else. For this problem, I do not see that I will need this &lt;STRONG&gt;combined&lt;/STRONG&gt; class anywhere else.&lt;/P&gt;

&lt;P&gt;I will try to further illustrate the problem to chase the root cause.&lt;BR /&gt;
I am using Splunk of version 7.2.1&lt;/P&gt;

&lt;P&gt;Inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[default]
host = hostname
_SYSLOG_ROUTING = devicename

queueSize = 20GB
persistentQueueSize = 30GB
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am trying to catch logs coming in from port 1234. Since the logs are coming in alright, I am assuming that the configuration in Inputs.conf is all good. Or should I use port somewhere in there?&lt;/P&gt;

&lt;P&gt;The logs coming in are multiline and my primary purpose is to stitch the logs by replacing new line characters with "|". However, after failing to do so with multiple configurations, first I am determined to replace alphabets.&lt;/P&gt;

&lt;P&gt;The above configuration is all that I have configured for solaris:ldap in /opt/splunk/etc/system/local. I checked using the btool and there are other fields and values which are used from /opt/splunk/etc/system/default.&lt;/P&gt;

&lt;P&gt;The log sample I have given above is a complete line from a multiline log. It is not the first line of the log though. The complete log looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;time: 20180702100600
dn: uid=xx11111,ou=xxxxxx,ou=xxxxxx,dc=xx,dc=xxxx,dc=xxxx,dc=xxxx,dc=xxx,dc=xx
changetype: modify
replace: pwdFailureTime
-
replace: pwdAccountLockedTime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jan 2019 06:42:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-characters-in-logs-using-SEDCMD-in-props-conf-in/m-p/392308#M70068</guid>
      <dc:creator>kirandhakal25</dc:creator>
      <dc:date>2019-01-07T06:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace characters in logs using SEDCMD in props.conf in Splunk Heavy Forwarder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-characters-in-logs-using-SEDCMD-in-props-conf-in/m-p/392309#M70069</link>
      <description>&lt;P&gt;HI  @mmodestino_splunk :&lt;/P&gt;

&lt;P&gt;I am facing same issue with removing backslashes from logs using SEDCMD in props on indexer.&lt;BR /&gt;
when I run query | rex mode=sed "s/\\//g" in search it works but when I put same entry as below in props on indexer it doesnt work:&lt;/P&gt;

&lt;P&gt;SEDCMD-RemovingBackSlash = s/\\//g&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 11:34:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-characters-in-logs-using-SEDCMD-in-props-conf-in/m-p/392309#M70069</guid>
      <dc:creator>tkmads1</dc:creator>
      <dc:date>2019-05-31T11:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace characters in logs using SEDCMD in props.conf in Splunk Heavy Forwarder?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-characters-in-logs-using-SEDCMD-in-props-conf-in/m-p/392310#M70070</link>
      <description>&lt;P&gt;Hi @tkmads, &lt;/P&gt;

&lt;P&gt;The best way to test your sed is to use the &lt;CODE&gt;add data&lt;/CODE&gt; then hit &lt;CODE&gt;upload&lt;/CODE&gt;and modify that option from there. At least that way you can troubleshoot your sed.&lt;/P&gt;

&lt;P&gt;Having done that on my side, this is the right sed to include in your &lt;CODE&gt;props.conf&lt;/CODE&gt; :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-RemovingBackSlash = s/\\//g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if you're able to test it out yourself.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 11:54:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-characters-in-logs-using-SEDCMD-in-props-conf-in/m-p/392310#M70070</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-31T11:54:32Z</dc:date>
    </item>
  </channel>
</rss>

