<?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: Trim off a trailing comma before the end of an event, SEDCMD? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Trim-off-a-trailing-comma-before-the-end-of-an-event-SEDCMD/m-p/79911#M16438</link>
    <description>&lt;P&gt;Try &lt;CODE&gt;SEDCMD-remove-trailing-json-comma = s/\,$//&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 30 Mar 2013 01:37:02 GMT</pubDate>
    <dc:creator>ShaneNewman</dc:creator>
    <dc:date>2013-03-30T01:37:02Z</dc:date>
    <item>
      <title>Trim off a trailing comma before the end of an event, SEDCMD?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Trim-off-a-trailing-comma-before-the-end-of-an-event-SEDCMD/m-p/79910#M16437</link>
      <description>&lt;P&gt;I have a set of events, each a JSON object, separated from each other as one-per-line (SHOULD_LINEMERGE = false), but each of the JSON objects ends its line of text with a trailing comma:&lt;/P&gt;

&lt;P&gt;...}},&lt;/P&gt;

&lt;P&gt;How do I use a SEDCMD to trim off that comma? Just this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-remove-trailing-json-comma = s/,$/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...or do I need to match the line-feed at the end of each event too?&lt;/P&gt;

&lt;P&gt;NOTE: I'm assuming I should put this SEDCMD into my props.conf on my Splunk heavy-forwarder, one-hop upstream from my core-indexer. Any advice is welcome. The above SEDCMD doesn't seem to work.&lt;/P&gt;

&lt;P&gt;From the logs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunkd.log.2:03-30-2013 00:02:07.330 +0000 ERROR regexExtractionProcessor - Error while parsing sed name="SEDCMD-remove-trailing-json-comma", string="s/,$/", errMsg="Failed to initialize sed. Failed to parse the replacement string."
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Mar 2013 00:13:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Trim-off-a-trailing-comma-before-the-end-of-an-event-SEDCMD/m-p/79910#M16437</guid>
      <dc:creator>evan_scheessele</dc:creator>
      <dc:date>2013-03-30T00:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Trim off a trailing comma before the end of an event, SEDCMD?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Trim-off-a-trailing-comma-before-the-end-of-an-event-SEDCMD/m-p/79911#M16438</link>
      <description>&lt;P&gt;Try &lt;CODE&gt;SEDCMD-remove-trailing-json-comma = s/\,$//&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2013 01:37:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Trim-off-a-trailing-comma-before-the-end-of-an-event-SEDCMD/m-p/79911#M16438</guid>
      <dc:creator>ShaneNewman</dc:creator>
      <dc:date>2013-03-30T01:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Trim off a trailing comma before the end of an event, SEDCMD?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Trim-off-a-trailing-comma-before-the-end-of-an-event-SEDCMD/m-p/79912#M16439</link>
      <description>&lt;P&gt;I updated your syntax slightly.  &lt;CODE&gt;SEDCMD&lt;/CODE&gt; (like its &lt;CODE&gt;sed&lt;/CODE&gt; great-grandfather) looks for a "find" and a "replace" which are (by convention) separated by the &lt;CODE&gt;/&lt;/CODE&gt; character.  So, to remove a trailing comma, you need to have the "replace" be an empty string.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2013 02:36:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Trim-off-a-trailing-comma-before-the-end-of-an-event-SEDCMD/m-p/79912#M16439</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2013-03-30T02:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Trim off a trailing comma before the end of an event, SEDCMD?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Trim-off-a-trailing-comma-before-the-end-of-an-event-SEDCMD/m-p/79913#M16440</link>
      <description>&lt;P&gt;Thanks - this ended up working for me, very similar. Yeah, I missed that final /&lt;/P&gt;

&lt;P&gt;SEDCMD-remove-trailing-json-comma = s/,$//&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2013 16:03:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Trim-off-a-trailing-comma-before-the-end-of-an-event-SEDCMD/m-p/79913#M16440</guid>
      <dc:creator>evan_scheessele</dc:creator>
      <dc:date>2013-04-01T16:03:42Z</dc:date>
    </item>
  </channel>
</rss>

