<?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 Batch DB input With a column ID in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Batch-DB-input-With-a-column-ID/m-p/329181#M61065</link>
    <description>&lt;P&gt;I want to do a Batch DB input because the table in the DB I'm pulling from deletes records instead of marks them with a soft deleted column. So what i want to do is pull the whole table in every 10 minutes with a batch db input, but then when i query the indexed data i want to only look at the latest dataset pulled in the batch process, so that I don't include records that were deleted in the DB. &lt;/P&gt;

&lt;P&gt;Is this possible? Does splunk have some Batch IDs where i can just use the latest batch? &lt;/P&gt;</description>
    <pubDate>Thu, 02 Mar 2017 00:47:17 GMT</pubDate>
    <dc:creator>tdiestel</dc:creator>
    <dc:date>2017-03-02T00:47:17Z</dc:date>
    <item>
      <title>Batch DB input With a column ID</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Batch-DB-input-With-a-column-ID/m-p/329181#M61065</link>
      <description>&lt;P&gt;I want to do a Batch DB input because the table in the DB I'm pulling from deletes records instead of marks them with a soft deleted column. So what i want to do is pull the whole table in every 10 minutes with a batch db input, but then when i query the indexed data i want to only look at the latest dataset pulled in the batch process, so that I don't include records that were deleted in the DB. &lt;/P&gt;

&lt;P&gt;Is this possible? Does splunk have some Batch IDs where i can just use the latest batch? &lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 00:47:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Batch-DB-input-With-a-column-ID/m-p/329181#M61065</guid>
      <dc:creator>tdiestel</dc:creator>
      <dc:date>2017-03-02T00:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Batch DB input With a column ID</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Batch-DB-input-With-a-column-ID/m-p/329182#M61066</link>
      <description>&lt;P&gt;If there's no way of differentiating the data between queries, here's a couple of ways I would approach this.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;_indextime&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;When querying your data in Splunk, you could specify that you only want to see data that was indexed in the last 10 minutes. Example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal earliest=-10m latest=now() | addinfo | where ((_indextime &amp;gt; info_min_time) AND (_indextime &amp;lt; info_max_time))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;sysdate()&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Or, when running your batch input SQL query, create a timestamp using &lt;CODE&gt;sysdate()&lt;/CODE&gt;. Example(Using MySQL):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SELECT 
   column1, 
   column2, 
   UNIX_TIMESTAMP(sysdate()) AS query_time, 
   column3
FROM table1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This would mean, every event that is indexed would contain the timestamp(query_time) of when the query was executed on the database. This method will rely on your database server time being the same as your Splunk server time.&lt;/P&gt;

&lt;P&gt;Then your Splunk search could be: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=_internal earliest=-10m latest=now() | addinfo | where ((query_time &amp;gt; info_min_time) AND (querytime &amp;lt; info_max_time))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 09:39:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Batch-DB-input-With-a-column-ID/m-p/329182#M61066</guid>
      <dc:creator>ktugwell_splunk</dc:creator>
      <dc:date>2017-03-02T09:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Batch DB input With a column ID</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Batch-DB-input-With-a-column-ID/m-p/329183#M61067</link>
      <description>&lt;P&gt;These are great tips. Thank you very much for the help. &lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 17:33:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Batch-DB-input-With-a-column-ID/m-p/329183#M61067</guid>
      <dc:creator>tdiestel</dc:creator>
      <dc:date>2017-03-02T17:33:42Z</dc:date>
    </item>
  </channel>
</rss>

