<?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: How to query data on an index that is monitoring a directory with CSV files? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125526#M25880</link>
    <description>&lt;P&gt;Looks like you don't have a timestamp in your events, therefore you are propably left with &lt;CODE&gt;_indextime&lt;/CODE&gt; Which is a default field, it represents the time when your event where indexed.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Sep 2014 18:04:08 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-09-16T18:04:08Z</dc:date>
    <item>
      <title>How to query data on an index that is monitoring a directory with CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125518#M25872</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;

&lt;P&gt;Can anyone please tell me how to write a search query on index which is monitoring a directory having CSV files with 10 columns. Suppose Col1, col2,col3...col10. For CSV we can write as below &lt;/P&gt;

&lt;P&gt;| inputcsv File_Name.csv | rename Col1as DOB, Col2 as Number_C, Col3 as "Day of Birth ", Col4 as "Month of Birth ", Col5 as "Day of Birth ", Col6 as "Birth year", Col7 as "First name",Col8 as Location,Col9 as "Country Code",Col10 as Year| eval Catg = case(Year &amp;lt; 1920,"Under 1920",Year &amp;gt;= 1920 AND Year &amp;lt;= 1980,"Between 1920-1980", Year &amp;gt; 1980, "Above 1980")&lt;/P&gt;

&lt;P&gt;How to convert this query on an index.&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Aashish Kumar&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:35:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125518#M25872</guid>
      <dc:creator>aashish_122001</dc:creator>
      <dc:date>2020-09-28T17:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to query data on an index that is monitoring a directory with CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125519#M25873</link>
      <description>&lt;P&gt;Hi aashish_122001,&lt;/P&gt;

&lt;P&gt;if you indexed your csv, for example, into &lt;CODE&gt;index=foo&lt;/CODE&gt; then simply do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo | rename Col1as DOB, Col2 as Number_C, Col3 as "Day of Birth ", Col4 as "Month of Birth ", Col5 as "Day of Birth ", Col6 as "Birth year", Col7 as "First name",Col8 as Location,Col9 as "Country Code",Col10 as Year| eval Catg = case(Year &amp;lt; 1920,"Under 1920",Year &amp;gt;= 1920 AND Year &amp;lt;= 1980,"Between 1920-1980", Year &amp;gt; 1980, "Above 1980")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2014 06:12:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125519#M25873</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-09-16T06:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to query data on an index that is monitoring a directory with CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125520#M25874</link>
      <description>&lt;P&gt;Thank you MuS..&lt;BR /&gt;
 It worked !!!&lt;/P&gt;

&lt;P&gt;Suppose I load a file with 100 records starting from 1....100 now I load another file in same directory say, 25 records whose keys are already present but the measure value is changed in new file...&lt;BR /&gt;
Now in indexed directory there are 2 files File 1 : 100 records , File 2 : 25 records &lt;BR /&gt;
What will be the behavior of index in this case...&lt;BR /&gt;
If it shows 125 records, then how can I display the latest 100 records ?&lt;/P&gt;

&lt;P&gt;Thank You.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2014 08:03:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125520#M25874</guid>
      <dc:creator>aashish_122001</dc:creator>
      <dc:date>2014-09-16T08:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to query data on an index that is monitoring a directory with CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125521#M25875</link>
      <description>&lt;P&gt;Splunk will only index new data if the CRC of the old data does not matches. In your example case it should/would be 125. To display only the latest 100 events, you can use &lt;CODE&gt;| tail 100&lt;/CODE&gt; in your search.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2014 08:31:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125521#M25875</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-09-16T08:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to query data on an index that is monitoring a directory with CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125522#M25876</link>
      <description>&lt;P&gt;in addition, it also could be that the file will produce a file too small error in that case you have to change some settings like seekptr checksum or crcSalt - best thing to do: test and try it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2014 08:35:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125522#M25876</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-09-16T08:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to query data on an index that is monitoring a directory with CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125523#M25877</link>
      <description>&lt;P&gt;Yes you are right..I tested it myself I got 100 record in first go &amp;amp; then 125 after loading 2nd file...&lt;BR /&gt;
What I did to resolve is to Stop the server, Clean the data on index &amp;amp; restart the server...now it shows latest records..&lt;BR /&gt;
Is there any better way to get the latest record without using tail command...because in my requirement, going forward there will be a large number of files in 1 directory &amp;amp; I have to report on top of them&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2014 10:16:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125523#M25877</guid>
      <dc:creator>aashish_122001</dc:creator>
      <dc:date>2014-09-16T10:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to query data on an index that is monitoring a directory with CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125524#M25878</link>
      <description>&lt;P&gt;Well, if your events have a time stamp and this will recognized by Splunk you can use the time stamp &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2014 10:30:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125524#M25878</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-09-16T10:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to query data on an index that is monitoring a directory with CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125525#M25879</link>
      <description>&lt;P&gt;can you please explain your answer...I will tell you the requirement tell me how we can use timestamp here...&lt;/P&gt;

&lt;P&gt;I loaded a File1 on say 16 Sep&lt;BR /&gt;
Id Name&lt;BR /&gt;
1   John&lt;BR /&gt;
2   Michael&lt;BR /&gt;
3 Aashish&lt;/P&gt;

&lt;P&gt;After that I loaded a File2 on 17 Sep&lt;BR /&gt;
Id Name&lt;BR /&gt;
3 Michael&lt;BR /&gt;
4 Aashish&lt;BR /&gt;
5 Stephen&lt;/P&gt;

&lt;P&gt;Now, Index will show me 6 records with duplicates for ID : 3&lt;BR /&gt;
Id Name&lt;BR /&gt;
1   John&lt;BR /&gt;
2   Michael&lt;BR /&gt;
3 Aashish&lt;BR /&gt;
3 Michael&lt;BR /&gt;
4 Aashish&lt;BR /&gt;
5 Stephen&lt;/P&gt;

&lt;P&gt;How I can use timestamp here to resolve the issue..&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2014 15:45:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125525#M25879</guid>
      <dc:creator>aashish_122001</dc:creator>
      <dc:date>2014-09-16T15:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to query data on an index that is monitoring a directory with CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125526#M25880</link>
      <description>&lt;P&gt;Looks like you don't have a timestamp in your events, therefore you are propably left with &lt;CODE&gt;_indextime&lt;/CODE&gt; Which is a default field, it represents the time when your event where indexed.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2014 18:04:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125526#M25880</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-09-16T18:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to query data on an index that is monitoring a directory with CSV files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125527#M25881</link>
      <description>&lt;P&gt;you can use  ...| dedup ID  if you want to restrict your search to recent values of the same ID&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2014 19:00:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-query-data-on-an-index-that-is-monitoring-a-directory/m-p/125527#M25881</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2014-09-16T19:00:56Z</dc:date>
    </item>
  </channel>
</rss>

