<?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: Splunk - stop auto indexing JSON in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-stop-auto-indexing-JSON/m-p/410626#M95583</link>
    <description>&lt;P&gt;Thankyou lakshman, just to clarify, if my log event is:&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
timestamp="2019-02-27 09:40:23,312" ,&lt;BR /&gt;
level="INFO",&lt;BR /&gt;
class="myClassName.class",&lt;BR /&gt;
payload = {&lt;BR /&gt;
"field1" : "value 1",&lt;BR /&gt;
"field2" : "value 2",&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
"field100": "value100"&lt;BR /&gt;
}&lt;BR /&gt;
}&lt;BR /&gt;
Since Splunk will automatically extract fields for JSON format, I want the extracted fields to be timestamp, level, class, payload.&lt;/P&gt;

&lt;P&gt;I do not want nested fields field1, field2 . . . field100 to be extracted.&lt;/P&gt;

&lt;P&gt;Will spath give me this behavior?&lt;/P&gt;</description>
    <pubDate>Wed, 27 Feb 2019 18:14:30 GMT</pubDate>
    <dc:creator>namrithadeepak</dc:creator>
    <dc:date>2019-02-27T18:14:30Z</dc:date>
    <item>
      <title>Splunk - stop auto indexing JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-stop-auto-indexing-JSON/m-p/410624#M95581</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a log that looks like the below,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2019-02-27 09:40:23,312 | INFO  | [myapp-metrics-publisher] | [myapp.core.instrument.CustomMetrics.CustomRegistry] | MY_APP | {payload={headers={content-type=application/json}, method=POST, body={userOrder={order=[{type={orderCd=ELECTRONICS, symbolCd=EL159, market={countryCd=MFD}}, orderInstruction={orderTypeCd=MARKET, deliveryCd=EXPEDITED, weekendInd=false, actionCd=BUY, returnPolicyInd=false, allOrNoneInd=false, dollarAmt=222.11, residencyCd=ON, payOnDeliveryInd=false}, account={accountNum=1111F}, traderInfo={behalfCd=AMA, traderRRId=AMAEL6, fxRate=11}, commission={deliveryGauranteedInd=true}, orderControl={proNonProInd=false, prospectusInd=true}}], alternativeUserId=ABC01, strategyCd=SPL, cashbackInd=true}, conditionRapid={acknowledgeActionCd=AUTO}}, url=http://100.100.100.100:8080/v1/userorders}, headers={sequenceNumber=1, orderExecutionId=1a2b3c4d-5678-91e0-11f2-1234567g890h, file_name=20190225-143730.trigger, sequenceSize=1, jms_destination=MY.SAMPLE.DESTINATION.00, JMSXUserID=AMAEL101145, Solace_JMS_Prop_IS_Reply_Message=false, priority=0, jms_timestamp=1551123465128, file_relativePath=20190225-143730.trigger, JMS_Solace_isXML=true, jms_redelivered=false, JMS_Solace_DeliverToOne=false, orderExecutionId=1a2b3c4d-5678-91e0-11f2-1234567g890h, JMS_Solace_ElidingEligible=false, orderId=1a2b3c4d-5678-91e0-11f2-1234567g890h, JMS_Solace_DeadMsgQueueEligible=false, traceId=1a2b3c4d-5678-9e0f1g2h-3456, firstTrade=true, id=1ab2345-67c8-90d1-23e4-ff5678901234, contentType=application/json, jms_messageId=ID:01.23.456.789abc24a0:0, timestamp=1551123465399}} | userId = [] | orderId = [] | process.files.open{} value=37 files
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;I have 2 questions:&lt;/STRONG&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Part of the log message is JSON and part of it is regular logging. Will Splunk automatically index the JSON and give me fields like orderCd, symbolCd etc. (although only part of the message is JSON)?&lt;/LI&gt;
&lt;LI&gt;Assume that I convert the whole log line to JSON,I do not want my payload to be indexed into individual fields i.e. I want Splunk to give me the field payload = &lt;CODE&gt;&amp;lt;the whole payload&amp;gt;&lt;/CODE&gt;, and no fields called orderCd, symbolCd etc.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Namritha&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 15:26:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-stop-auto-indexing-JSON/m-p/410624#M95581</guid>
      <dc:creator>namrithadeepak</dc:creator>
      <dc:date>2019-02-27T15:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk - stop auto indexing JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-stop-auto-indexing-JSON/m-p/410625#M95582</link>
      <description>&lt;P&gt;for 1  - no splunk will treat the whole line as an event.&lt;BR /&gt;
for 2 - if you convert the log into json (including timestamp), splunk will use json sourcetype to parse the complete event. you can then use spath to extract the fields you want.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 15:37:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-stop-auto-indexing-JSON/m-p/410625#M95582</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2019-02-27T15:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk - stop auto indexing JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-stop-auto-indexing-JSON/m-p/410626#M95583</link>
      <description>&lt;P&gt;Thankyou lakshman, just to clarify, if my log event is:&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
timestamp="2019-02-27 09:40:23,312" ,&lt;BR /&gt;
level="INFO",&lt;BR /&gt;
class="myClassName.class",&lt;BR /&gt;
payload = {&lt;BR /&gt;
"field1" : "value 1",&lt;BR /&gt;
"field2" : "value 2",&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
"field100": "value100"&lt;BR /&gt;
}&lt;BR /&gt;
}&lt;BR /&gt;
Since Splunk will automatically extract fields for JSON format, I want the extracted fields to be timestamp, level, class, payload.&lt;/P&gt;

&lt;P&gt;I do not want nested fields field1, field2 . . . field100 to be extracted.&lt;/P&gt;

&lt;P&gt;Will spath give me this behavior?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 18:14:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-stop-auto-indexing-JSON/m-p/410626#M95583</guid>
      <dc:creator>namrithadeepak</dc:creator>
      <dc:date>2019-02-27T18:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk - stop auto indexing JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-stop-auto-indexing-JSON/m-p/410627#M95584</link>
      <description>&lt;P&gt;Yes, that will be the behaviour. You can your sample (like the format above) and upload to your dev instance with json sourcetype and you can see how it gets parsed/indexed/extracted.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 20:15:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-stop-auto-indexing-JSON/m-p/410627#M95584</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2019-02-27T20:15:19Z</dc:date>
    </item>
  </channel>
</rss>

