<?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 How to compare the columns values against another column in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-the-columns-values-against-another-column/m-p/587017#M204446</link>
    <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I am having a query which would result as below,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-03-01 at 7.39.44 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18184i6D0567659B5FF554/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-03-01 at 7.39.44 PM.png" alt="Screenshot 2022-03-01 at 7.39.44 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The above shows count by xyz for the user selected timerange.&amp;nbsp; I would like to add one more column to this table as &lt;STRONG&gt;LessThanThreshold - &lt;/STRONG&gt;which would tell the number of times the count in each day was below the corresponding T&lt;STRONG&gt;hreshold &lt;/STRONG&gt;value.&lt;/P&gt;&lt;P&gt;To be precise for a row, if the value of &lt;STRONG&gt;01-Mar-22&lt;/STRONG&gt; &amp;lt; &lt;STRONG&gt;Threshold&amp;nbsp;&lt;/STRONG&gt;then increment the new column&amp;nbsp;&lt;STRONG&gt;LessThanThreshold&amp;nbsp;&lt;/STRONG&gt;by 1, if &lt;STRONG&gt;28-Feb-22&amp;lt;Threshold&lt;/STRONG&gt;, then increment&amp;nbsp;&lt;STRONG&gt;LessThanThreshold &lt;/STRONG&gt;by 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using Foreach I am not sure to compare between columns itself. Could someone please help me out here.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 01 Mar 2022 14:19:16 GMT</pubDate>
    <dc:creator>sangs8788</dc:creator>
    <dc:date>2022-03-01T14:19:16Z</dc:date>
    <item>
      <title>How to compare the columns values against another column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-the-columns-values-against-another-column/m-p/587017#M204446</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I am having a query which would result as below,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-03-01 at 7.39.44 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18184i6D0567659B5FF554/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-03-01 at 7.39.44 PM.png" alt="Screenshot 2022-03-01 at 7.39.44 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The above shows count by xyz for the user selected timerange.&amp;nbsp; I would like to add one more column to this table as &lt;STRONG&gt;LessThanThreshold - &lt;/STRONG&gt;which would tell the number of times the count in each day was below the corresponding T&lt;STRONG&gt;hreshold &lt;/STRONG&gt;value.&lt;/P&gt;&lt;P&gt;To be precise for a row, if the value of &lt;STRONG&gt;01-Mar-22&lt;/STRONG&gt; &amp;lt; &lt;STRONG&gt;Threshold&amp;nbsp;&lt;/STRONG&gt;then increment the new column&amp;nbsp;&lt;STRONG&gt;LessThanThreshold&amp;nbsp;&lt;/STRONG&gt;by 1, if &lt;STRONG&gt;28-Feb-22&amp;lt;Threshold&lt;/STRONG&gt;, then increment&amp;nbsp;&lt;STRONG&gt;LessThanThreshold &lt;/STRONG&gt;by 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using Foreach I am not sure to compare between columns itself. Could someone please help me out here.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 14:19:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-the-columns-values-against-another-column/m-p/587017#M204446</guid>
      <dc:creator>sangs8788</dc:creator>
      <dc:date>2022-03-01T14:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare the columns values against another column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-the-columns-values-against-another-column/m-p/587019#M204447</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval LessThanThreshold=0
| foreach *-*-*
    [| eval LessThanThreshold=if('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;' &amp;lt; Threshold, LessThanThreshold+1, LessThanThreshold)]&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 01 Mar 2022 14:33:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-the-columns-values-against-another-column/m-p/587019#M204447</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-01T14:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare the columns values against another column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-the-columns-values-against-another-column/m-p/587036#M204455</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/51135"&gt;@sangs8788&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just piggybacked on&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;solution&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;| makeresults | eval xyz = 571273637828, 01-mar-22=26, 28-feb-22=13, Threshold =3, TotalCount=39&lt;BR /&gt;|append [|makeresults | eval xyz = 571273633123, 01-mar-22=1352, 28-feb-22=1702, Threshold =332, TotalCount=3054]&lt;BR /&gt;|append [|makeresults | eval xyz = 571273633267, 01-mar-22=0, 28-feb-22=40, Threshold =3, TotalCount=40]&lt;BR /&gt;|foreach *-*-22 [eval &amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;&amp;lt;&amp;lt;MATCHSEG2&amp;gt;&amp;gt;-22_Threshold = if('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;' &amp;lt; Threshold,"LessThanThreshold_by_1","OK")]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="venky1544_0-1646148151707.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18185i6C10E92B81B76FE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="venky1544_0-1646148151707.png" alt="venky1544_0-1646148151707.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 15:22:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-the-columns-values-against-another-column/m-p/587036#M204455</guid>
      <dc:creator>venky1544</dc:creator>
      <dc:date>2022-03-01T15:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare the columns values against another column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-the-columns-values-against-another-column/m-p/587066#M204465</link>
      <description>&lt;P&gt;Thanks. It worked. Didnt know that I can use&amp;nbsp;&lt;STRONG&gt;Threshold &lt;/STRONG&gt;field inside foreach without being included in foreach condition.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 17:29:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-the-columns-values-against-another-column/m-p/587066#M204465</guid>
      <dc:creator>sangs8788</dc:creator>
      <dc:date>2022-03-01T17:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare the columns values against another column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-the-columns-values-against-another-column/m-p/587068#M204466</link>
      <description>&lt;P&gt;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168" target="_self"&gt;&lt;SPAN class=""&gt;ITWhisperer&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Is there a possible way to consider only the latest date column value alone and compare it with threshold field?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 17:36:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-the-columns-values-against-another-column/m-p/587068#M204466</guid>
      <dc:creator>sangs8788</dc:creator>
      <dc:date>2022-03-01T17:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare the columns values against another column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-the-columns-values-against-another-column/m-p/587069#M204467</link>
      <description>&lt;P&gt;Thanks for you response. This would work too. But I want more of a count rather than OK or NOT. Appreciate your effort. Thanks again&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 17:39:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-the-columns-values-against-another-column/m-p/587069#M204467</guid>
      <dc:creator>sangs8788</dc:creator>
      <dc:date>2022-03-01T17:39:47Z</dc:date>
    </item>
  </channel>
</rss>

