<?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: Remove { } from json file before indexing in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Remove-from-json-file-before-indexing/m-p/403514#M71687</link>
    <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;you're only missing a single char: &lt;CODE&gt;s/^{//g&lt;/CODE&gt; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps - if it does I'd be happy if you would upvote/accept this answer, so others could profit from it. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 18 May 2018 07:20:05 GMT</pubDate>
    <dc:creator>xpac</dc:creator>
    <dc:date>2018-05-18T07:20:05Z</dc:date>
    <item>
      <title>Remove { } from json file before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Remove-from-json-file-before-indexing/m-p/403513#M71686</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;

&lt;P&gt;i am trying to index a local json file, but when going trough the sourcetype the predefined json source type is not reading the file properly..splunk put everything in one line...no detecting time format or something (see attached file)&lt;/P&gt;

&lt;P&gt;then i found that splunk is not indexing separate events because the json file starts with { and ends with } if i removed those character splunk will give me a line per event.&lt;/P&gt;

&lt;P&gt;does someone knows how I can  remove the { at the beginning and the } at the end with splunk before indexing?&lt;/P&gt;

&lt;P&gt;i'm putting this when i go through wizard data inpout local file in the advance section&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;SEDCMD-removesymbol = s/^{/g   (this is not working)&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;thanks&lt;BR /&gt;
{&lt;BR /&gt;
     "records": &lt;BR /&gt;
     [&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     {
         "time": "2018-05-11T13:29:03Z",        
          "GatewayId": "4r566-5678-4753-968f-34568",
          "Region": "unknown",
           "operationName": "ApplicationGatewayAccess",
           "category": "ApplicationGatewayAccessLog",
         }
     ,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;{&lt;BR /&gt;
              "time": "2018-05-11T13:29:05Z",&lt;BR /&gt;&lt;BR /&gt;
              "GatewayId": "4r566-ae57-dfg543-968f-xxx45t67",&lt;BR /&gt;
              "Region": "unknown",&lt;BR /&gt;
              "operationName": "ApplicationGatewayAccess",&lt;BR /&gt;
              "category": "ApplicationGatewayAccessLog",&lt;BR /&gt;
             }&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;can someone please help me ?&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2018 02:35:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Remove-from-json-file-before-indexing/m-p/403513#M71686</guid>
      <dc:creator>abilis</dc:creator>
      <dc:date>2018-05-18T02:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Remove { } from json file before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Remove-from-json-file-before-indexing/m-p/403514#M71687</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;you're only missing a single char: &lt;CODE&gt;s/^{//g&lt;/CODE&gt; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps - if it does I'd be happy if you would upvote/accept this answer, so others could profit from it. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2018 07:20:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Remove-from-json-file-before-indexing/m-p/403514#M71687</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-18T07:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Remove { } from json file before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Remove-from-json-file-before-indexing/m-p/403515#M71688</link>
      <description>&lt;P&gt;I've being working in this  issue for two days and still don't undestand what the SEDCMD-class = s/^{//g  is NOT removing the starting" { " during the data preview.  if i dont remove the starting " { " from the .json file i'm trying to index, splunk will put all the events in 1 line&lt;/P&gt;

&lt;P&gt;i have tried many combinations but still not working..data preview always show all event in one line, &lt;BR /&gt;
SEDCMD-class =s/^{//g &lt;BR /&gt;
SEDCMD-class =s/^{//&lt;BR /&gt;
SEDCMD-class =s/{//g&lt;BR /&gt;
SEDCMD-class =s/{/&lt;/P&gt;

&lt;P&gt;when removing manually the starting " { ", splunk is able to display 1 event per record in the .json file...all my .json files start with " { "  and this is how Microsoft format it...don't know why&lt;/P&gt;

&lt;P&gt;can someone help me to figure this out ???&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
"records":
[

          {
              "time": "2018-05-11T13:29:03Z",        
               "GatewayId": "4r566-5678-4753-968f-34568",
               "Region": "unknown",
                "operationName": "ApplicationGatewayAccess",
                "category": "ApplicationGatewayAccessLog",
              }
          ,

{
"time": "2018-05-11T13:29:05Z",
"GatewayId": "4r566-ae57-dfg543-968f-xxx45t67",
"Region": "unknown",
"operationName": "ApplicationGatewayAccess",
"category": "ApplicationGatewayAccessLog",
}
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 May 2018 16:53:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Remove-from-json-file-before-indexing/m-p/403515#M71688</guid>
      <dc:creator>abilis</dc:creator>
      <dc:date>2018-05-18T16:53:59Z</dc:date>
    </item>
  </channel>
</rss>

