<?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: Not all the JSON files from the same folder location being indexed? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Not-all-the-JSON-files-from-the-same-folder-location-being/m-p/483042#M82755</link>
    <description>&lt;P&gt;If your script is overwriting these files every time in your DIR-B, a batch input will work. Just keep in mind that Splunk will delete this file after it has been indexed. You could do something like the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# inputs.conf
[batch:///home/DIR-B]
index = test
move_policy = sinkhole
whitelist = .*\.json



# props.conf
# Add the following to your props on the forwarder
[source::...A2.json]
sourcetype = test1

[source::...B2.json]
sourcetype = test2

[source::...C2.json]
sourcetype = test3

[source::...D2.json]
sourcetype = test4
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 28 Apr 2020 15:15:00 GMT</pubDate>
    <dc:creator>zacharychristen</dc:creator>
    <dc:date>2020-04-28T15:15:00Z</dc:date>
    <item>
      <title>Not all the JSON files from the same folder location being indexed?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-all-the-JSON-files-from-the-same-folder-location-being/m-p/483039#M82752</link>
      <description>&lt;P&gt;Environment : Heavy forwarder -&amp;gt; Indexers cluster -&amp;gt; SH&lt;/P&gt;

&lt;P&gt;ON HWF side :&lt;BR /&gt;
I am fetching logs using the Curl command which goes to directory DIR-A and following files are created :&lt;BR /&gt;
These files gets downloaded everyday 10:00 am and before that script clean up all the old files from both DIR-A and DIR-B&lt;/P&gt;

&lt;P&gt;A1.json&lt;BR /&gt;
B1.json&lt;BR /&gt;
C1.json&lt;BR /&gt;
D1.json&lt;/P&gt;

&lt;P&gt;Now these files have header and footer which needs to be removed before they indexed as json.&lt;/P&gt;

&lt;P&gt;so i have another script which schedule to run after 10 min these files are downloaded in DIR-A&lt;BR /&gt;
This script remove the header and footer from these files and copy them to New Dir DIR-B as follow :&lt;/P&gt;

&lt;P&gt;A2.json&lt;BR /&gt;
B2.json&lt;BR /&gt;
C2.json&lt;BR /&gt;
D2.json&lt;/P&gt;

&lt;P&gt;till here everything works fine.&lt;/P&gt;

&lt;P&gt;The issue start when I see 3 files indexed in splunk out of 4 or sometimes 2 out of 4.&lt;BR /&gt;
I dont see any error in internal logs for files which are not indexed.&lt;/P&gt;

&lt;P&gt;here is my input.conf :&lt;/P&gt;

&lt;P&gt;[monitor:///home/DIR-B/A2.json]&lt;BR /&gt;
index = test&lt;BR /&gt;
crcSalt = sourcetype = test1 disabled = false&lt;/P&gt;

&lt;P&gt;[monitor:///home/DIR-B/B2.json]&lt;BR /&gt;
index = test&lt;BR /&gt;
crcSalt = sourcetype = test2 disabled = false&lt;/P&gt;

&lt;P&gt;[monitor:///home/DIR-B/C2.json]&lt;BR /&gt;
index = test&lt;BR /&gt;
crcSalt = sourcetype = test3 disabled = false&lt;/P&gt;

&lt;P&gt;[monitor:///home/DIR-B/D2.json]&lt;BR /&gt;
index = test&lt;BR /&gt;
crcSalt = sourcetype = test4 disabled = false&lt;/P&gt;

&lt;P&gt;props.conf : for all the sourcetype test1,test2,test3,test4 is same as below :&lt;/P&gt;

&lt;P&gt;DATETIME_CONFIG = CURRENT&lt;BR /&gt;
INDEXED_EXTRACTIONS = json&lt;BR /&gt;
KV_MODE = false&lt;BR /&gt;
AUTO_KV_JSON = false&lt;BR /&gt;
NO_BINARY_CHECK = true&lt;BR /&gt;
category = Structured&lt;BR /&gt;
disabled = false&lt;BR /&gt;
pulldown_type = true&lt;/P&gt;

&lt;P&gt;ON SH side settings :&lt;/P&gt;

&lt;P&gt;props.conf for sourcetype test1,test2,test3,test4&lt;/P&gt;

&lt;P&gt;KV_MODE = false&lt;BR /&gt;
AUTO_KV_JSON = false&lt;BR /&gt;
___-&lt;/P&gt;

&lt;P&gt;The strange part is if i edit the file ( the file which is not indexed) and add something like #test at the beginning of file and restart splunk it will get indexed fine.&lt;/P&gt;

&lt;P&gt;Here is the pattern of the file which is having issue.&lt;/P&gt;

&lt;P&gt;[&lt;BR /&gt;
{"AAA":"ZZZZ-000","lastSeen":XXXX,"hash":"XXXXXXXXXXXX"},&lt;BR /&gt;
{"BBB":"MMMM-000","lastSeen":XXXX,"hash":"XXXXXXXXXXXX"},&lt;BR /&gt;
{"CCC":"yyyy-000","lastSeen":XXXX,"hash":"XXXXXXXXXXXX"}&lt;BR /&gt;
]&lt;/P&gt;

&lt;P&gt;Please suggest if i need to use batch instead of monitor or any other suggestion ?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:08:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-all-the-JSON-files-from-the-same-folder-location-being/m-p/483039#M82752</guid>
      <dc:creator>mrao5</dc:creator>
      <dc:date>2020-09-30T05:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Not all the JSON files from the same folder location being indexed?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-all-the-JSON-files-from-the-same-folder-location-being/m-p/483040#M82753</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Are you salting the files on pourpose using the crcSalt (I could not tell from the conf files)? &lt;BR /&gt;
Do these files have any form of timestamp in them?&lt;BR /&gt;
Do they by any chance generate the same hash value (possibly splunk thinks it has already indexed them)?&lt;/P&gt;</description>
      <pubDate>Sat, 25 Apr 2020 16:44:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-all-the-JSON-files-from-the-same-folder-location-being/m-p/483040#M82753</guid>
      <dc:creator>jaime_ramirez</dc:creator>
      <dc:date>2020-04-25T16:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Not all the JSON files from the same folder location being indexed?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-all-the-JSON-files-from-the-same-folder-location-being/m-p/483041#M82754</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;Yes i am using crcSalt on purpose. This the settings i have placed . &lt;/P&gt;

&lt;P&gt;crcSalt = &lt;/P&gt;

&lt;P&gt;Yes, some of the files have timestamp but that is in future timestamp, Hence i am forcing the timestamp to current with the help of :&lt;BR /&gt;
DATETIME_CONFIG = CURRENT&lt;/P&gt;

&lt;P&gt;Nope, all the hash values are different.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Apr 2020 17:19:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-all-the-JSON-files-from-the-same-folder-location-being/m-p/483041#M82754</guid>
      <dc:creator>mrao5</dc:creator>
      <dc:date>2020-04-25T17:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Not all the JSON files from the same folder location being indexed?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-all-the-JSON-files-from-the-same-folder-location-being/m-p/483042#M82755</link>
      <description>&lt;P&gt;If your script is overwriting these files every time in your DIR-B, a batch input will work. Just keep in mind that Splunk will delete this file after it has been indexed. You could do something like the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# inputs.conf
[batch:///home/DIR-B]
index = test
move_policy = sinkhole
whitelist = .*\.json



# props.conf
# Add the following to your props on the forwarder
[source::...A2.json]
sourcetype = test1

[source::...B2.json]
sourcetype = test2

[source::...C2.json]
sourcetype = test3

[source::...D2.json]
sourcetype = test4
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Apr 2020 15:15:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-all-the-JSON-files-from-the-same-folder-location-being/m-p/483042#M82755</guid>
      <dc:creator>zacharychristen</dc:creator>
      <dc:date>2020-04-28T15:15:00Z</dc:date>
    </item>
  </channel>
</rss>

