<?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: Best way to get the latest data from csv file that gets re-indexed with no fixed schedule in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536952#M36695</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;just curious why are you setting the earliest and latest values in this line? Is metadata really attributed to time?&lt;/P&gt;&lt;PRE&gt;| metasearch index=my_index sourcetype="$sourcetype$" earliest=-31d@d latest=now &lt;/PRE&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229611"&gt;@termcap&lt;/a&gt;,&amp;nbsp;fyi, i would recommend same solution as well&lt;/P&gt;</description>
    <pubDate>Sun, 24 Jan 2021 16:29:22 GMT</pubDate>
    <dc:creator>spammenot66</dc:creator>
    <dc:date>2021-01-24T16:29:22Z</dc:date>
    <item>
      <title>Best way to get the latest data from csv file that gets re-indexed with no fixed schedule</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536924#M36684</link>
      <description>&lt;P&gt;I am monitoring a CSV file and creating a dashboard based on it, the file is modified many times a day, or not for many days at all.&lt;/P&gt;&lt;P&gt;The file has not just rows added to it but also removed, plus the file contents are edited which will cause Splunk to re-index the whole file.&lt;/P&gt;&lt;P&gt;I can't use latest command because latest will return those lines which were deleted by the user as well and I can't set a range because I do not know when was the file last changed.&amp;nbsp; Due to the above issues my dashboard will always be inconsistent&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only way I can think of solving this problem is&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. If I can somehow get all old events of the files removed from Splunk and then index the file, then run queries will "All Time"&lt;/P&gt;&lt;P&gt;2. Write a script that reads the csv, append a time date-time-field, re-creates a new csv which is monitored. Do this every 15 minutes causing the Splunk monitor to re-index the whole file every 15 minutes. (But this causes another issue, if the user updates the dashboard they can get partial or extra data depending on when the open the dashboard relative to 15 minutes)&lt;/P&gt;&lt;P&gt;Any ideas how this problem can be solved in a more elegant manner ?&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 13:45:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536924#M36684</guid>
      <dc:creator>termcap</dc:creator>
      <dc:date>2021-01-23T13:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to get the latest data from csv file that gets re-indexed with no fixed schedule</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536926#M36685</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229611"&gt;@termcap&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can set&amp;nbsp;&lt;STRONG&gt;DATETIME_CONFIG = CURRENT&lt;/STRONG&gt; to the monitor input in &lt;STRONG&gt;props.conf&lt;/STRONG&gt; which sets &lt;STRONG&gt;_time&lt;/STRONG&gt; of events in the file to&amp;nbsp;modification timestamp on that file being read. Then you can filter all the events based on the latest _time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;base_search&amp;gt; | eventstats latest(_time) as timestamp | where _time=timestamp&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you, an upvote/like would be appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 14:19:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536926#M36685</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-01-23T14:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to get the latest data from csv file that gets re-indexed with no fixed schedule</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536928#M36686</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129090"&gt;@manjunathmeti&lt;/a&gt;&amp;nbsp; this sounds like a good solution but there are some reservations&lt;/P&gt;&lt;P&gt;If I have understood the solution correctly then this should work if the whole file is being indexed every time, but if the user just adds a new line to the file, then just that line will be indexed and then when I run the query based on latest, I will end up with just the new changed line ?&lt;/P&gt;&lt;P&gt;As I understand, on deleting the last line of the file, there will be no change to the index, so running the latest query will still return the line that no longer exists in the actual CSV file that is with the user.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 14:34:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536928#M36686</guid>
      <dc:creator>termcap</dc:creator>
      <dc:date>2021-01-23T14:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to get the latest data from csv file that gets re-indexed with no fixed schedule</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536930#M36687</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229611"&gt;@termcap&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I encountered this problem in one of my projects and I solved it with a search that I putted in a macro to avoid to have all the search in all my search.&lt;/P&gt;&lt;P&gt;In my situation, I have six data flows. all in the same index and each one with a different sourcetype, they arrive in different dates (two everyday, one weekly, one every 14 days two monthly).&lt;/P&gt;&lt;P&gt;So this is my macro that I call in my dashbard panel passing the sourcetype as parameter to it:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=my_index sourcetype="$sourcetype$" [ | metasearch index=my_index sourcetype="$sourcetype$" earliest=-31d@d latest=now | head 1 | eval earliest=relative_time(_time,"-1h"), latest=relative_time(_time,"1h") | fields earliest latest ]&lt;/LI-CODE&gt;&lt;P&gt;for your needs, you can reduce the earliest time e.g. to 24 hours or less.&lt;/P&gt;&lt;P&gt;In few words: the subsearch says to the main search the timestamp of the last arrive.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 15:29:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536930#M36687</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-01-23T15:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to get the latest data from csv file that gets re-indexed with no fixed schedule</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536947#M36694</link>
      <description>&lt;P&gt;You can reindex the file every time it is updated. Set&amp;nbsp;&lt;STRONG&gt;CHECK_METHOD = entire_md5 | modtime&lt;/STRONG&gt; for source file path&amp;nbsp;in &lt;STRONG&gt;props.conf&lt;/STRONG&gt; on forwarder. Note that &lt;STRONG&gt;CHECK_METHOD&lt;/STRONG&gt; should be configured for the source only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[source::/path/to/file]
CHECK_METHOD = modtime&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2021 06:11:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536947#M36694</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-01-24T06:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to get the latest data from csv file that gets re-indexed with no fixed schedule</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536952#M36695</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;just curious why are you setting the earliest and latest values in this line? Is metadata really attributed to time?&lt;/P&gt;&lt;PRE&gt;| metasearch index=my_index sourcetype="$sourcetype$" earliest=-31d@d latest=now &lt;/PRE&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229611"&gt;@termcap&lt;/a&gt;,&amp;nbsp;fyi, i would recommend same solution as well&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2021 16:29:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536952#M36695</guid>
      <dc:creator>spammenot66</dc:creator>
      <dc:date>2021-01-24T16:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to get the latest data from csv file that gets re-indexed with no fixed schedule</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536956#M36696</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;This is a good solution but my problem is compounded by the fact that Splunk will only index the lines that were added to the csv (unless its edited such that Splunk is forced to send the full file).&lt;/P&gt;&lt;P&gt;I this case I will not get the contents of the file that were sent before the earliest was set using the subquery.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2021 17:54:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536956#M36696</guid>
      <dc:creator>termcap</dc:creator>
      <dc:date>2021-01-24T17:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to get the latest data from csv file that gets re-indexed with no fixed schedule</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536957#M36697</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/97643"&gt;@spammenot66&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I needed to create this subsearch to define the time borders for the main search, because I had different frequency of sources uploads and, in addition, I wasn't sure that that frequency was respected!&lt;/P&gt;&lt;P&gt;So I created that subsearch (that's very quick) to define the time borders for the main search: when I have the timestamp of the last indexed event I took all the events indexed in the period + or - 1h of the timestamp.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2021 18:02:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536957#M36697</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-01-24T18:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to get the latest data from csv file that gets re-indexed with no fixed schedule</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536958#M36698</link>
      <description>&lt;P&gt;@termcap the original question asks "how to get the latest data" right? &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp; provided the right solution. If you're trying to do something more, it should be stated in the question.&lt;/P&gt;&lt;P&gt;having said that, what exactly are you trying to solve for in this specific scenario? its obviously not - checking for latest values from csv file.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2021 18:03:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536958#M36698</guid>
      <dc:creator>spammenot66</dc:creator>
      <dc:date>2021-01-24T18:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to get the latest data from csv file that gets re-indexed with no fixed schedule</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536961#M36700</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/97643"&gt;@spammenot66&lt;/a&gt;the solution provided by &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt; solves my problem but only partially because Splunk does not re-index all the contents of the file if a file is changed at the end, Splunk will only index the last line.&lt;/P&gt;&lt;P&gt;In this case I will get the last changed line of the file if its between the time frame mentioned in the sub-search but I won't get old lines which are "latest" from the point of view of the csv because I have no way to know how much back should I go to get those lines and then even there I don't know if its all the lines from the file as it exists now or still lines are missing.&lt;/P&gt;&lt;P&gt;Plus there is always the chance of deleted lines being returned, those deleted from the csv but existing in the index.&lt;/P&gt;&lt;P&gt;The solution i've arrived at is to reindex the whole file if the timestamp of the file changes with CURRENT as the DATE_CONFIG as suggested by &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129090"&gt;@manjunathmeti&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2021 18:49:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536961#M36700</guid>
      <dc:creator>termcap</dc:creator>
      <dc:date>2021-01-24T18:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to get the latest data from csv file that gets re-indexed with no fixed schedule</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536991#M36703</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229611"&gt;@termcap&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;in this case, you could have a different approach:&lt;/P&gt;&lt;P&gt;schedule a search (e.g. each hour, or every ten minutes) that takes all the values you ned deduping the values and save results in a summary index or in a lookup.&lt;/P&gt;&lt;P&gt;In this way you're sure to have the updated values in this lookup or summary index&amp;nbsp;and then you can make your searches (if summary index using my query) here, obviously you always have an update time related to the frequency of your scheduled search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 07:44:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Best-way-to-get-the-latest-data-from-csv-file-that-gets-re/m-p/536991#M36703</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-01-25T07:44:59Z</dc:date>
    </item>
  </channel>
</rss>

