<?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: Compare text strings over 2 days in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Compare-text-strings-over-2-days/m-p/580068#M13359</link>
    <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;diff&lt;/FONT&gt; command does indeed work on strings, but produces output like that of the Linux diff command, which probably is not what you seek.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;@@ -1 +1 @@
-Bar Foo1.txt Foo Bar1.txt
+Bar 1.txt Foo Bar1.txt&lt;/LI-CODE&gt;&lt;P&gt;I regret that don't know how to solve the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jan 2022 00:55:25 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-01-06T00:55:25Z</dc:date>
    <item>
      <title>Compare text strings over 2 days</title>
      <link>https://community.splunk.com/t5/Alerting/Compare-text-strings-over-2-days/m-p/580015#M13356</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i have a log file which is capturing processed files.&lt;/P&gt;&lt;P&gt;The file text always has the same string, its just the date prefix which changes.&amp;nbsp;&lt;BR /&gt;So i would like to read in the files processed today and compare to yesterday and how the difference.&lt;/P&gt;&lt;P&gt;I have used the answers to other questions to get the file date read in by day, however the diff command does not work, is this only for integers rather than string.&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; Successfully&lt;/SPAN&gt; &lt;SPAN class=""&gt;processed&lt;/SPAN&gt; &lt;SPAN class=""&gt;file&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;20211105-zone-Foo&lt;/SPAN&gt;&amp;nbsp;Bar&lt;SPAN class=""&gt;1.txt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; Successfully processed file&lt;/SPAN&gt; 20211105-zone-Bar 1.txt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;Successfully processed file&lt;/SPAN&gt; 20211106_zone-Foo&amp;nbsp;Bar1.txt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;Successfully processed file&lt;/SPAN&gt; 20211106-zone-Bar Foo1.txt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;index=foo source=bar earliest=-1d@d latest=now "Successfully processed file"&lt;BR /&gt;| rex "\-zone\-(?&amp;lt;File&amp;gt;.+)"&lt;BR /&gt;| eval Day=if(_time&amp;lt;relative_time(now(),"@d"),"Yesterday","Today")&lt;BR /&gt;| chart values(File) by Day&lt;BR /&gt;| eval Diff=Yesterday-Today&lt;BR /&gt;| where Yesterday!=Today&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;i would like to report that&amp;nbsp;Bar 1.txt and&amp;nbsp;Bar Foo1.txt are the differences.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 15:13:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Compare-text-strings-over-2-days/m-p/580015#M13356</guid>
      <dc:creator>ssaenger</dc:creator>
      <dc:date>2022-01-05T15:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Compare text strings over 2 days</title>
      <link>https://community.splunk.com/t5/Alerting/Compare-text-strings-over-2-days/m-p/580068#M13359</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;diff&lt;/FONT&gt; command does indeed work on strings, but produces output like that of the Linux diff command, which probably is not what you seek.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;@@ -1 +1 @@
-Bar Foo1.txt Foo Bar1.txt
+Bar 1.txt Foo Bar1.txt&lt;/LI-CODE&gt;&lt;P&gt;I regret that don't know how to solve the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 00:55:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Compare-text-strings-over-2-days/m-p/580068#M13359</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-01-06T00:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Compare text strings over 2 days</title>
      <link>https://community.splunk.com/t5/Alerting/Compare-text-strings-over-2-days/m-p/580079#M13360</link>
      <description>&lt;P&gt;Please check this.. this works fine picking up the Date and File name..&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval log= "Successfully processed file 20211105-zone-Foo Bar1.txt
Successfully processed file 20211105-zone-Bar 1.txt
Successfully processed file 20211106_zone-Foo Bar1.txt
Successfully processed file 20211106-zone-Bar Foo1.txt"
| rex field=log max_match=0 "(?P&amp;lt;Date&amp;gt;\d+)\-zone\-(?&amp;lt;File&amp;gt;.+)"
| table Date File&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have come up with compare logic, but the eval works only once.. not sure of how to do the eval multiple times..&amp;nbsp; &amp;nbsp;as you have the real logs, pls check this and update us what happen:&lt;/P&gt;&lt;P&gt;| makeresults | eval log= "Successfully processed file 20211105-zone-Foo Bar1.txt&lt;BR /&gt;Successfully processed file 20211105-zone-Bar 1.txt&lt;BR /&gt;Successfully processed file 20211106_zone-Foo Bar1.txt&lt;BR /&gt;Successfully processed file 20211106-zone-Bar Foo1.txt"&lt;BR /&gt;| rex field=log max_match=0 "(?P&amp;lt;Date&amp;gt;\d+)\-zone\-(?&amp;lt;File&amp;gt;.+)"&lt;BR /&gt;| eval compare=strptime(Date,"%Y%m%d")&lt;BR /&gt;| where compare &amp;gt; strptime(Date,"%Y%m%d")&lt;BR /&gt;| table Date File Day&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rex-date.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17422i5552D09F1BF5B1E3/image-size/large?v=v2&amp;amp;px=999" role="button" title="rex-date.png" alt="rex-date.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 03:56:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Compare-text-strings-over-2-days/m-p/580079#M13360</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2022-01-06T03:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Compare text strings over 2 days</title>
      <link>https://community.splunk.com/t5/Alerting/Compare-text-strings-over-2-days/m-p/580108#M13361</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw= "Successfully processed file 20211105-zone-Foo Bar1.txt
Successfully processed file 20211105-zone-Bar 1.txt
Successfully processed file 20211106-zone-Foo Bar1.txt
Successfully processed file 20211106-zone-Bar Foo1.txt"
| multikv noheader=t
| table _raw
``` The lines above set up example data (correcting typo?) ```
| rex "(?&amp;lt;date&amp;gt;\d+)\-zone\-(?&amp;lt;file&amp;gt;.+)"
| stats count by file
| where count = 1&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 06 Jan 2022 11:22:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Compare-text-strings-over-2-days/m-p/580108#M13361</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-01-06T11:22:07Z</dc:date>
    </item>
  </channel>
</rss>

