<?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: Why is Splunk not extracting all fields in JSON? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436686#M76184</link>
    <description>&lt;P&gt;Hey MousumiChowdhury,&lt;/P&gt;

&lt;P&gt;Thx for your reply.&lt;/P&gt;

&lt;P&gt;I don’t know why my link doesn’t work on my previous post, so the screenshot is there : &lt;A href="https://www.dropbox.com/s/du5pkwqzwyi8miq/Capture%20d%E2%80%99%C3%A9cran%202018-10-17%20%C3%A0%2009.56.02.png?dl=0"&gt;https://www.dropbox.com/s/du5pkwqzwyi8miq/Capture%20d%E2%80%99%C3%A9cran%202018-10-17%20%C3%A0%2009.56.02.png?dl=0&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;My problem is very simple. I use Docker Container and I have configured Splunk logging drivers on my container to send logs through Splunk HTTP Event Collector. My Docker Log Driver is set up to send data in &lt;STRONG&gt;json&lt;/STRONG&gt; format and Splunk seems to have received logs in good format. But, if I search for certain fields, like &lt;STRONG&gt;tag&lt;/STRONG&gt; in my example, Splunk seem not extracted this field and no result resturn from search.&lt;/P&gt;

&lt;P&gt;Why Splunk not extract all fields?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Wed, 17 Oct 2018 15:42:51 GMT</pubDate>
    <dc:creator>LordSnooz</dc:creator>
    <dc:date>2018-10-17T15:42:51Z</dc:date>
    <item>
      <title>Why is Splunk not extracting all fields in JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436684#M76182</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I don't understand why Splunk show the field &lt;STRONG&gt;tag&lt;/STRONG&gt; in &lt;EM&gt;List&lt;/EM&gt; view and not in view &lt;EM&gt;Raw&lt;/EM&gt; and &lt;EM&gt;Table&lt;/EM&gt;.&lt;/P&gt;

&lt;P&gt;Also, this field is not selectable... Why? &lt;/P&gt;

&lt;P&gt;Line : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"line":"[\u001b[37minfo\u001b[0m] k.m.a.c.BrokerViewCacheActor - Updating broker view...","source":"stdout","tag":"7b91119dbad4","attrs":{"appName":"kafka-manager","appType":"kafka-manager"}}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have a screenshot of the problem I'm talking about : &lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.dropbox.com/s/du5pkwqzwyi8miq/Capture%20d%E2%80%99%C3%A9cran%202018-10-17%20%C3%A0%2009.56.02.png?dl=0"&gt;https://www.dropbox.com/s/du5pkwqzwyi8miq/Capture%20d%E2%80%99%C3%A9cran%202018-10-17%20%C3%A0%2009.56.02.png?dl=0&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 14:04:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436684#M76182</guid>
      <dc:creator>LordSnooz</dc:creator>
      <dc:date>2018-10-17T14:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk not extracting all fields in JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436685#M76183</link>
      <description>&lt;P&gt;Hey! Can you attach the screenshot? Also, if you could share a tad more information would be helpful to understand the problem. &lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 15:02:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436685#M76183</guid>
      <dc:creator>MousumiChowdhur</dc:creator>
      <dc:date>2018-10-17T15:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk not extracting all fields in JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436686#M76184</link>
      <description>&lt;P&gt;Hey MousumiChowdhury,&lt;/P&gt;

&lt;P&gt;Thx for your reply.&lt;/P&gt;

&lt;P&gt;I don’t know why my link doesn’t work on my previous post, so the screenshot is there : &lt;A href="https://www.dropbox.com/s/du5pkwqzwyi8miq/Capture%20d%E2%80%99%C3%A9cran%202018-10-17%20%C3%A0%2009.56.02.png?dl=0"&gt;https://www.dropbox.com/s/du5pkwqzwyi8miq/Capture%20d%E2%80%99%C3%A9cran%202018-10-17%20%C3%A0%2009.56.02.png?dl=0&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;My problem is very simple. I use Docker Container and I have configured Splunk logging drivers on my container to send logs through Splunk HTTP Event Collector. My Docker Log Driver is set up to send data in &lt;STRONG&gt;json&lt;/STRONG&gt; format and Splunk seems to have received logs in good format. But, if I search for certain fields, like &lt;STRONG&gt;tag&lt;/STRONG&gt; in my example, Splunk seem not extracted this field and no result resturn from search.&lt;/P&gt;

&lt;P&gt;Why Splunk not extract all fields?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 15:42:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436686#M76184</guid>
      <dc:creator>LordSnooz</dc:creator>
      <dc:date>2018-10-17T15:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk not extracting all fields in JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436687#M76185</link>
      <description>&lt;P&gt;@LordSnooz,&lt;/P&gt;

&lt;P&gt;Your provided JSON is proper and provided screen is confirming that &lt;CODE&gt;tag&lt;/CODE&gt; must be extracted. You can try below search also for that.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval _raw="{\"line\":\"[\u001b[37minfo\u001b[0m] k.m.a.c.BrokerViewCacheActor - Updating broker view...\",\"source\":\"stdout\",\"tag\":\"7b91119dbad4\",\"attrs\":{\"appName\":\"kafka-manager\",\"appType\":\"kafka-manager\"}}" | kv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have a question regarding extraction. Specially if you had done any CIM related mapping. Can you please confirm that there are no extraction which can &lt;STRONG&gt;nullify&lt;/STRONG&gt; the &lt;CODE&gt;tag&lt;/CODE&gt; value?  if any then you can search after removing such extraction. This is just for testing. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 16:02:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436687#M76185</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-10-17T16:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk not extracting all fields in JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436688#M76186</link>
      <description>&lt;P&gt;Thx @kamlesh_vaghela &lt;/P&gt;

&lt;P&gt;You're right, Splunk is extracting all the fields with makeresults!&lt;/P&gt;

&lt;P&gt;But, how I make simple search base on this field like this ? &lt;CODE&gt;index=ecs-dev attrs.appName=ms-communicationservice tag=f47474ce8091&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 16:32:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436688#M76186</guid>
      <dc:creator>LordSnooz</dc:creator>
      <dc:date>2018-10-17T16:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk not extracting all fields in JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436689#M76187</link>
      <description>&lt;P&gt;I found something, but I don't understand why... If I disable the SplunkApp &lt;CODE&gt;Splunk Add-on for AWS&lt;/CODE&gt;, my field &lt;CODE&gt;tag&lt;/CODE&gt; as automatically extracted... &lt;/P&gt;

&lt;P&gt;Do you have a clue how to fix that?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 18:26:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436689#M76187</guid>
      <dc:creator>LordSnooz</dc:creator>
      <dc:date>2018-10-17T18:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk not extracting all fields in JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436690#M76188</link>
      <description>&lt;P&gt;@LordSnooz,&lt;/P&gt;

&lt;P&gt;I think it is because tag is Splunk's Internal fields. I have did some workaround ad It works for me.&lt;/P&gt;

&lt;P&gt;1) I have created &lt;CODE&gt;temp&lt;/CODE&gt; sourcetype ad indexed your given sample into it using below search. You can skip this step if you have already these events.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval _raw="{\"line\":\"[\u001b[37minfo\u001b[0m] k.m.a.c.BrokerViewCacheActor - Updating broker view...\",\"source\":\"stdout\",\"tag\":\"7b91119dbad4\",\"attrs\":{\"appName\":\"kafka-manager\",\"appType\":\"kafka-manager\"}}" | collect index=main sourcetype=temp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2) I have added eval to store original &lt;CODE&gt;tag&lt;/CODE&gt; value in another field &lt;CODE&gt;my_tag&lt;/CODE&gt; by adding &lt;CODE&gt;EVAL&lt;/CODE&gt; under &lt;CODE&gt;temp&lt;/CODE&gt; stanza in props.conf. Add eval in your existing sourcetype stanza.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[temp]
.
.
.
EVAL-my_tag = tag
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3) execute search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=temp my_tag="7b91119dbad4"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try and let me know if it is working for you or not.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 20:13:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436690#M76188</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-10-17T20:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk not extracting all fields in JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436691#M76189</link>
      <description>&lt;P&gt;You rock! Your solution work perfectly if I create new source type.&lt;/P&gt;

&lt;P&gt;I see two things.&lt;/P&gt;

&lt;P&gt;1) If I use your solution, but with _json source type, it does not work. So it has a parameter that comes into conflict&lt;BR /&gt;
2) This afternoon I discovered that by disabling the Splunk Add-on for AWS, Splunk extracts natively all fields of json input without problems.&lt;/P&gt;

&lt;P&gt;I have two solutions, use your workaround or discover why this App change the behaviour of the _json source type.&lt;/P&gt;

&lt;P&gt;I'm not a Splunk expert... I probably used your solution lol&lt;/P&gt;

&lt;P&gt;Thank you for your time, I appreciate!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 00:49:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436691#M76189</guid>
      <dc:creator>LordSnooz</dc:creator>
      <dc:date>2018-10-18T00:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk not extracting all fields in JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436692#M76190</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/210069"&gt;@LordSnooz&lt;/a&gt; &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;For this purpose, I going to use the Splunk _json sourcetype default settings (It works in my case)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;
&lt;STRONG&gt;&lt;EM&gt;My sourcetype name for this example will be "test"&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;A workaround to do this would be the following:&lt;/P&gt;

&lt;P&gt;1) Create a custom sourcetype &lt;BR /&gt;
2) Configure your custom sourcetype (in opt/splunk/etc/system/local/props.conf) as:&lt;/P&gt;

&lt;P&gt;[ test ]&lt;BR /&gt;
SHOULD_LINEMERGE=true&lt;BR /&gt;
LINE_BREAKER=([\r\n]+)&lt;BR /&gt;
NO_BINARY_CHECK=true&lt;BR /&gt;
CHARSET=AUTO&lt;BR /&gt;
INDEXED_EXTRACTIONS=json&lt;BR /&gt;
KV_MODE=none&lt;BR /&gt;
category=Structured&lt;BR /&gt;
description=JavaScript Object Notation format. For more information, visit &lt;A href="http://json.org/" target="_blank"&gt;http://json.org/&lt;/A&gt;&lt;BR /&gt;
disabled=false&lt;BR /&gt;
pulldown_type=true&lt;BR /&gt;
EVAL-my_tag = tag&lt;/P&gt;

&lt;P&gt;3) Configure your data input (Using the sourcetype created, [ test ] in my case )&lt;BR /&gt;
4) Search your results&lt;/P&gt;

&lt;P&gt;index=&amp;lt; your_index_name &amp;gt; sourcetype=test my_tag="7b91119dbad4"&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Please try and let me know if it is working for you or not.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:51:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-extracting-all-fields-in-JSON/m-p/436692#M76190</guid>
      <dc:creator>marend</dc:creator>
      <dc:date>2020-09-30T00:51:04Z</dc:date>
    </item>
  </channel>
</rss>

