<?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: Passing comparison operators in a variable in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Passing-comparison-operators-in-a-variable/m-p/467539#M131577</link>
    <description>&lt;P&gt;There are only ugly options, e.g. iterating through all operators with &lt;CODE&gt;case()&lt;/CODE&gt;, or &lt;CODE&gt;map&lt;/CODE&gt;. What are you trying to achieve?&lt;/P&gt;</description>
    <pubDate>Mon, 06 Apr 2020 22:44:53 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2020-04-06T22:44:53Z</dc:date>
    <item>
      <title>Passing comparison operators in a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-comparison-operators-in-a-variable/m-p/467538#M131576</link>
      <description>&lt;P&gt;Is there a way to dynamically pass a comparison operator as a variable without a macro?  I am looking to achieve something similar to what is shown below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval number=8
| eval operator="&amp;gt;="
| eval comparison=7
| eval validate=if(number.operator.comparison,"yep","nope")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Apr 2020 22:35:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-comparison-operators-in-a-variable/m-p/467538#M131576</guid>
      <dc:creator>ohbuckeyeio</dc:creator>
      <dc:date>2020-04-06T22:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Passing comparison operators in a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-comparison-operators-in-a-variable/m-p/467539#M131577</link>
      <description>&lt;P&gt;There are only ugly options, e.g. iterating through all operators with &lt;CODE&gt;case()&lt;/CODE&gt;, or &lt;CODE&gt;map&lt;/CODE&gt;. What are you trying to achieve?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 22:44:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-comparison-operators-in-a-variable/m-p/467539#M131577</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2020-04-06T22:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Passing comparison operators in a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-comparison-operators-in-a-variable/m-p/467540#M131578</link>
      <description>&lt;P&gt;Hi Martin.  I have a kvstore with rows that have a numerical field and an operator field (among others).  I would like to loop through those rows and build a dynamic comparison based off of some search results.&lt;/P&gt;

&lt;P&gt;In the example above, the field "number" is from an indexed search.  The operator and comparison fields are in the kvstore.  I would like to be able to dynamically compare the number/comparison fields based on the provided operator value.&lt;/P&gt;

&lt;P&gt;The operators could be any standard operator (=,!=,&amp;gt;=, etc...)&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 22:54:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-comparison-operators-in-a-variable/m-p/467540#M131578</guid>
      <dc:creator>ohbuckeyeio</dc:creator>
      <dc:date>2020-04-06T22:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Passing comparison operators in a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-comparison-operators-in-a-variable/m-p/467541#M131579</link>
      <description>&lt;P&gt;Considering there only are six common comparison operators &lt;CODE&gt;= != &amp;lt; &amp;lt;= &amp;gt; &amp;gt;=&lt;/CODE&gt; I'd recommend creating a macro that houses a big case statement.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 23:09:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-comparison-operators-in-a-variable/m-p/467541#M131579</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2020-04-06T23:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Passing comparison operators in a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Passing-comparison-operators-in-a-variable/m-p/467542#M131580</link>
      <description>&lt;P&gt;Thank you Martin.  I was assuming this would be the answer but was hoping for something more concise.  I appreciate the help.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 13:51:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Passing-comparison-operators-in-a-variable/m-p/467542#M131580</guid>
      <dc:creator>ohbuckeyeio</dc:creator>
      <dc:date>2020-04-07T13:51:28Z</dc:date>
    </item>
  </channel>
</rss>

