<?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: Collect command   to index in JSON format in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Collect-command-to-index-in-JSON-format/m-p/389751#M69750</link>
    <description>&lt;P&gt;&lt;A href="https://github.com/doksu/TA-jsontools/wiki"&gt;https://github.com/doksu/TA-jsontools/wiki&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2019 07:35:44 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-05-23T07:35:44Z</dc:date>
    <item>
      <title>Collect command   to index in JSON format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collect-command-to-index-in-JSON-format/m-p/389748#M69747</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;I'm trying to generate some summarized data by using the collect command in my SPL queries.&lt;/P&gt;

&lt;P&gt;The event format by default is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05/20/2019 07:15:00 +0200, info_min_time=1.000, info_max_time=1558557310.000, info_search_time=1558557310.410, field1=value1 field2=value2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Some of this fields, are actually JSON objects, like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05/20/2019 07:15:00 +0200, info_min_time=1.000, info_max_time=1558557310.000, info_search_time=1558557310.410, field1=value1 field2=value2 field3="{"subfield1":"subvalue1", "subfield2":"subvalue2",...}"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, to avois a mixture of formats in my collected event, I would like to index the results, using the collect command, BUT in JSON format for the whole event, something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"time":"05/20/2019 07:15:00 +0200", "info_min_time"=1.000, "info_max_time":1558557310.000, "info_search_time":1558557310.410, results: {"field1":"value1" "field2":"value2", field3="{"subfield1":"subvalue1", "subfield2":"subvalue2",...}"...}}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is such thing feasible? Some props tweaking?&lt;/P&gt;

&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 06:31:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collect-command-to-index-in-JSON-format/m-p/389748#M69747</guid>
      <dc:creator>alvaromari83</dc:creator>
      <dc:date>2019-05-23T06:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Collect command   to index in JSON format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collect-command-to-index-in-JSON-format/m-p/389749#M69748</link>
      <description>&lt;P&gt;You can look into it from two perspective&lt;BR /&gt;
1. Is the source data the most important thing in your organisation?&lt;BR /&gt;
2. If the data format is important&lt;/P&gt;

&lt;P&gt;In many organisation (1) is more important. This is to preserve the original data. Splunk doesn't have any issue in extracting data even if the JSON format is mixed. You index "original" data, but just mention the json part to extract automatically&lt;/P&gt;

&lt;P&gt;Please see this thread on how to index json mixed format. &lt;A href="https://answers.splunk.com/answers/117121/extract-json-data-within-the-logs-json-mixed-with.html"&gt;https://answers.splunk.com/answers/117121/extract-json-data-within-the-logs-json-mixed-with.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You could even add a stanza just to extract pure JSON if need be at search time. This way you preserve the original data as well as you get key-value at search-time&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 07:25:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collect-command-to-index-in-JSON-format/m-p/389749#M69748</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-23T07:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Collect command   to index in JSON format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collect-command-to-index-in-JSON-format/m-p/389750#M69749</link>
      <description>&lt;P&gt;@alvaromari83 &lt;/P&gt;

&lt;P&gt;Can you please try &lt;CODE&gt;| mkjson&lt;/CODE&gt; command from &lt;CODE&gt;JSON Tools&lt;/CODE&gt; Splunk App ?&lt;/P&gt;

&lt;P&gt;&lt;A href="https://splunkbase.splunk.com/app/3540/#/overview"&gt;https://splunkbase.splunk.com/app/3540/#/overview&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 07:35:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collect-command-to-index-in-JSON-format/m-p/389750#M69749</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-05-23T07:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Collect command   to index in JSON format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collect-command-to-index-in-JSON-format/m-p/389751#M69750</link>
      <description>&lt;P&gt;&lt;A href="https://github.com/doksu/TA-jsontools/wiki"&gt;https://github.com/doksu/TA-jsontools/wiki&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 07:35:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collect-command-to-index-in-JSON-format/m-p/389751#M69750</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-05-23T07:35:44Z</dc:date>
    </item>
  </channel>
</rss>

