<?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: Need splunk to compare data values with current date value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643624#M222956</link>
    <description>&lt;LI-CODE lang="markup"&gt;| transpose 0 header_field=TABLE_NAME
| where strptime(TABLE1,"%F") == relative_time(now(),"@d") AND strptime(TABLE2,"%F") == relative_time(now(),"-1d@d") AND strptime(TABLE3,"%F") == relative_time(now(),"@d")&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 17 May 2023 12:49:50 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-05-17T12:49:50Z</dc:date>
    <item>
      <title>How to compare data values with current date value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643606#M222945</link>
      <description>&lt;P&gt;Hi I have some data events with Date value&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to create splunk search if value of &lt;A href="https://gbappsplulp100:8000/en-US/app/splunk_app_db_connect/data_lab#" target="_blank" rel="noopener"&gt;MAX_POSITION_DATE&amp;nbsp; for TABLE2 SHOULD BE&amp;nbsp; (TODAY -1)&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and table 1 has TODAY value and table 3 has TODAY .&lt;/P&gt;
&lt;P&gt;i want to display any events if not met above condition&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; TABLES NAMES MAX_POSITION_DATE&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="774px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="60.875px" height="46px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="60.875px" height="46px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="352px" height="46px"&gt;TABLE1&lt;/TD&gt;
&lt;TD width="149.771px" height="46px"&gt;2023-05-17 00:00:00.000&lt;/TD&gt;
&lt;TD width="149.812px" height="46px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="60.875px" height="46px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="60.875px" height="46px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="352px" height="46px"&gt;TABLE2&lt;/TD&gt;
&lt;TD width="149.771px" height="46px"&gt;2023-05-16 00:00:00.000&lt;/TD&gt;
&lt;TD width="149.812px" height="46px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="60.875px" height="46px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="60.875px" height="46px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="352px" height="46px"&gt;TABLE3&lt;/TD&gt;
&lt;TD width="149.771px" height="46px"&gt;2023-05-17 00:00:00.000&lt;/TD&gt;
&lt;TD width="149.812px" height="46px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Wed, 17 May 2023 13:11:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643606#M222945</guid>
      <dc:creator>sekhar463</dc:creator>
      <dc:date>2023-05-17T13:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need splunk to compare data values with current date value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643612#M222948</link>
      <description>&lt;P&gt;SPL is not SQL - what are tables in this context?&lt;/P&gt;&lt;P&gt;Please can you share some anonymised events (in a code block &amp;lt;/&amp;gt;) to prevent formatting corruptions?&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 11:32:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643612#M222948</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-17T11:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need splunk to compare data values with current date value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643621#M222953</link>
      <description>&lt;P&gt;this data we have ingested in splunk as events&lt;/P&gt;&lt;P&gt;splunk search to get if value of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://gbappsplulp100:8000/en-US/app/splunk_app_db_connect/data_lab#" target="_blank" rel="noopener nofollow noreferrer"&gt;MAX_POSITION_DATE&amp;nbsp; for TABLE2 SHOULD BE&amp;nbsp; (TODAY -1)&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and table 1 has TODAY value and table 3 has TODAY .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have used search&amp;nbsp; but it was giving all events event condition not met for the data which i have given in the table&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;| search (TABLE1 AND MAX_POSITION_DATE!=@d-1) OR (TABLE2 AND MAX_POSITION_DATE!=@d) | stats count&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TABLE_NAME&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MAX_POSITION_DATE&lt;BR /&gt;TABLE1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2023-05-17 00:00:00.000&lt;BR /&gt;&amp;nbsp;TABLE2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2023-05-16 00:00:00.000&lt;BR /&gt;&amp;nbsp;TABLE3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2023-05-17 00:00:00.000&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 12:40:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643621#M222953</guid>
      <dc:creator>sekhar463</dc:creator>
      <dc:date>2023-05-17T12:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need splunk to compare data values with current date value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643624#M222956</link>
      <description>&lt;LI-CODE lang="markup"&gt;| transpose 0 header_field=TABLE_NAME
| where strptime(TABLE1,"%F") == relative_time(now(),"@d") AND strptime(TABLE2,"%F") == relative_time(now(),"-1d@d") AND strptime(TABLE3,"%F") == relative_time(now(),"@d")&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 17 May 2023 12:49:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643624#M222956</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-17T12:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need splunk to compare data values with current date value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643630#M222960</link>
      <description>&lt;P&gt;is transpose command required ?&lt;/P&gt;&lt;P&gt;and also i wanto compare by using&amp;nbsp;&lt;SPAN&gt;MAX_POSITION_DATE&amp;nbsp; filled&amp;nbsp;in the TABLE FIELDS( which has 3 tables )&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;if value of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://gbappsplulp100:8000/en-US/app/splunk_app_db_connect/data_lab#" target="_blank" rel="noopener nofollow noreferrer"&gt;MAX_POSITION_DATE&amp;nbsp; for TABLE2 SHOULD BE&amp;nbsp; (TODAY -1)&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and table 1 has TODAY value and table 3 has TODAY .&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 13:30:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643630#M222960</guid>
      <dc:creator>sekhar463</dc:creator>
      <dc:date>2023-05-17T13:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need splunk to compare data values with current date value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643632#M222961</link>
      <description>&lt;P&gt;Given the results of the stats command that you shared, then yes, it is required as it puts all the values in one event so that they can be compared to each other.&lt;/P&gt;&lt;P&gt;Don't forget that Splunk effectively processes events one at a time in the pipeline, so in order to do the comparison, the values need to be in the same event.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 13:31:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643632#M222961</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-17T13:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need splunk to compare data values with current date value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643637#M222963</link>
      <description>&lt;P&gt;not getting results&amp;nbsp;&lt;/P&gt;&lt;P&gt;HERE ARE THE SAMPLE EVENTS&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;5/17/23&lt;BR /&gt;5:20:01.653 PM&lt;BR /&gt;2023-05-17 05:50:01.653, TABLE_NAME="TABLE1", MAX_POSITION_DATE="2023-05-17 00:00:00.000", MAX_DMA_RUN_DATETIME="2023-05-17 11:03:40.479"&lt;BR /&gt;host = 127.0.0.1:8088source = ANG sourcetype = ANG Data layer&lt;BR /&gt;5/17/23&lt;BR /&gt;5:20:01.653 PM&lt;BR /&gt;2023-05-17 05:50:01.653, TABLE_NAME="TABLE2", MAX_POSITION_DATE="2023-05-16 00:00:00.000", MAX_DMA_RUN_DATETIME="2023-05-16 23:11:01.388"&lt;BR /&gt;host = 127.0.0.1:8088source = ANG sourcetype = ANG Data layer&lt;BR /&gt;5/17/23&lt;BR /&gt;5:20:01.653 PM&lt;BR /&gt;2023-05-17 05:50:01.653, TABLE_NAME="TABLE3", MAX_POSITION_DATE="2023-05-17 00:00:00.000", MAX_DMA_RUN_DATETIME="2023-05-17 11:03:42.879"&lt;BR /&gt;host = 127.0.0.1:8088source = ANG sourcetype = ANG Data layer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 13:46:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643637#M222963</guid>
      <dc:creator>sekhar463</dc:creator>
      <dc:date>2023-05-17T13:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need splunk to compare data values with current date value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643642#M222964</link>
      <description>&lt;P&gt;Here is a runanywhere example showing you it working with the data you provided. I have assume that the first part of each event is the _time field and stripped it from the _raw data&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval _raw="2023-05-17 05:50:01.653, TABLE_NAME=\"TABLE1\", MAX_POSITION_DATE=\"2023-05-17 00:00:00.000\", MAX_DMA_RUN_DATETIME=\"2023-05-17 11:03:40.479\"
2023-05-17 05:50:01.653, TABLE_NAME=\"TABLE2\", MAX_POSITION_DATE=\"2023-05-16 00:00:00.000\", MAX_DMA_RUN_DATETIME=\"2023-05-16 23:11:01.388\"
2023-05-17 05:50:01.653, TABLE_NAME=\"TABLE3\", MAX_POSITION_DATE=\"2023-05-17 00:00:00.000\", MAX_DMA_RUN_DATETIME=\"2023-05-17 11:03:42.879\""
| multikv noheader=t
| table _raw
| eval _time=strptime(_raw,"%F %T.%3N")
| rex "TABLE_NAME=\"(?&amp;lt;TABLE_NAME&amp;gt;[^\"]+).+MAX_POSITION_DATE=\"(?&amp;lt;MAX_POSITION_DATE&amp;gt;[^\"]+)"
| table TABLE_NAME MAX_POSITION_DATE
``` the lines above generate sample data in line with your example ```
| transpose 0 header_field=TABLE_NAME
| where strptime(TABLE1,"%F") == relative_time(now(),"@d") AND strptime(TABLE2,"%F") == relative_time(now(),"-1d@d") AND strptime(TABLE3,"%F") == relative_time(now(),"@d")&lt;/LI-CODE&gt;&lt;P&gt;If it is still not working for you, it is because you haven't provided an accurate enough representation of your events.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 14:14:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643642#M222964</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-17T14:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need splunk to compare data values with current date value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643645#M222966</link>
      <description>&lt;P&gt;this is the data in which already fields are there for TABLE NAME and MAX_POSITION_DATE&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;5/17/23&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5:20:01.653 PM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2023-05-17 05:50:01.653, TABLE_NAME="TABLE1", MAX_POSITION_DATE="2023-05-17 00:00:00.000", MAX_DMA_RUN_DATETIME="2023-05-17 11:03:40.479"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;host = 127.0.0.1:8088source = ANG sourcetype = ANG Data layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5/17/23&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5:20:01.653 PM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2023-05-17 05:50:01.653, TABLE_NAME="TABLE2", MAX_POSITION_DATE="2023-05-16 00:00:00.000", MAX_DMA_RUN_DATETIME="2023-05-16 23:11:01.388"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;host = 127.0.0.1:8088source = ANG sourcetype = ANG Data layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5/17/23&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5:20:01.653 PM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2023-05-17 05:50:01.653, TABLE_NAME="TABLE3", MAX_POSITION_DATE="2023-05-17 00:00:00.000", MAX_DMA_RUN_DATETIME="2023-05-17 11:03:42.879"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;host = 127.0.0.1:8088source = ANG sourcetype = ANG Data layer&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 14:20:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-values-with-current-date-value/m-p/643645#M222966</guid>
      <dc:creator>sekhar463</dc:creator>
      <dc:date>2023-05-17T14:20:02Z</dc:date>
    </item>
  </channel>
</rss>

