<?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: How to String Compare? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-String-Compare/m-p/181296#M52275</link>
    <description>&lt;P&gt;Hello! When you use &lt;STRONG&gt;Values (X)&lt;/STRONG&gt;, The order of the values is lexicographical. Try the &lt;STRONG&gt;list&lt;/STRONG&gt; function as follows and let me know what happen:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=xxx Status=Approved PartNo=$PartNo$ VendorCode=$VendorCode$ | Convert num(CurrentPrice) as CurrentPrice,num(VendorPrice1) as VendorPrice1,num(VendorPrice2) as VendorPrice2,,num(VendorPrice3) as VendorPrice3 | search ((VendorPrice1 &amp;amp;lt; CurrentPrice) OR (VendorPrice2 &amp;amp;lt; CurrentPrice) OR (VendorPrice3 &amp;amp;lt; CurrentPrice) ) |stats list(CurrentPrice) list(VendorPrice1) list(VendorPrice2) list(VendorPrice3) by RfqNo,PartNo,VendorCode
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 06 May 2015 10:46:07 GMT</pubDate>
    <dc:creator>stephanefotso</dc:creator>
    <dc:date>2015-05-06T10:46:07Z</dc:date>
    <item>
      <title>How to String Compare?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-String-Compare/m-p/181293#M52272</link>
      <description>&lt;P&gt;Hi Sir:&lt;BR /&gt;
My Raw data CurrentPrice,VendorPrice1...is string not number, so i use convert change fields attribute. I hope VendorPrice1 &amp;lt; CurrentPrice or VendorPrice2 &amp;lt; CurrentPrice or VendorPrice3 &amp;lt; CurrentPrice appear data and highlights red color. If use ... |search VendorPrice1 &amp;lt; 0.3345 | ... is fine, if use |search VendorPrice1 &amp;lt; CurrentPrice|  data is error, It can not seem to use than the size of the string, should can i do? Thank you.&lt;/P&gt;

&lt;P&gt;My RAW data:&lt;BR /&gt;
CurrentPrice    VendorPrice1  VendorPrice2 VendorPrice3&lt;BR /&gt;
 .3345                   .3303                    .3302                 .3305&lt;/P&gt;

&lt;P&gt;sourcetype=xxx Status=Approved PartNo=$PartNo$ VendorCode=$VendorCode$ | Convert num(CurrentPrice) as CurrentPrice,num(VendorPrice1) as VendorPrice1,num(VendorPrice2) as VendorPrice2,,num(VendorPrice3) as VendorPrice3 |  search ((VendorPrice1 &amp;lt; CurrentPrice) OR (VendorPrice2 &amp;lt; CurrentPrice) OR (VendorPrice3 &amp;lt; CurrentPrice) ) |stats values(CurrentPrice) values(VendorPrice1) values(VendorPrice2) values(VendorPrice3) by RfqNo,PartNo,VendorCode&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 07:16:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-String-Compare/m-p/181293#M52272</guid>
      <dc:creator>chengyu</dc:creator>
      <dc:date>2015-05-06T07:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to String Compare?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-String-Compare/m-p/181294#M52273</link>
      <description>&lt;P&gt;Is there any value of the CurrentPrice which is lesser than any of the VendorPrices? In current example, the current price value .3345 is largest among all the prices. &lt;/P&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 07:59:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-String-Compare/m-p/181294#M52273</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-05-06T07:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to String Compare?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-String-Compare/m-p/181295#M52274</link>
      <description>&lt;P&gt;In your case since you are comparing values in a field what you want to use is &lt;CODE&gt;where&lt;/CODE&gt; not &lt;CODE&gt;search&lt;/CODE&gt; as in&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | where VendorPrice1 &amp;amp;lt; CurrentPrice | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The search command like you've used it WILL work if you put in values as you've seen&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 10:42:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-String-Compare/m-p/181295#M52274</guid>
      <dc:creator>Runals</dc:creator>
      <dc:date>2015-05-06T10:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to String Compare?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-String-Compare/m-p/181296#M52275</link>
      <description>&lt;P&gt;Hello! When you use &lt;STRONG&gt;Values (X)&lt;/STRONG&gt;, The order of the values is lexicographical. Try the &lt;STRONG&gt;list&lt;/STRONG&gt; function as follows and let me know what happen:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=xxx Status=Approved PartNo=$PartNo$ VendorCode=$VendorCode$ | Convert num(CurrentPrice) as CurrentPrice,num(VendorPrice1) as VendorPrice1,num(VendorPrice2) as VendorPrice2,,num(VendorPrice3) as VendorPrice3 | search ((VendorPrice1 &amp;amp;lt; CurrentPrice) OR (VendorPrice2 &amp;amp;lt; CurrentPrice) OR (VendorPrice3 &amp;amp;lt; CurrentPrice) ) |stats list(CurrentPrice) list(VendorPrice1) list(VendorPrice2) list(VendorPrice3) by RfqNo,PartNo,VendorCode
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 May 2015 10:46:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-String-Compare/m-p/181296#M52275</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-05-06T10:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to String Compare?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-String-Compare/m-p/181297#M52276</link>
      <description>&lt;P&gt;Hi Runals:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;         I have try where command | where VendorPrice1 &amp;amp;lt; CurrentPrice |, result still  the same. 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 May 2015 11:44:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-String-Compare/m-p/181297#M52276</guid>
      <dc:creator>chengyu</dc:creator>
      <dc:date>2015-05-06T11:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to String Compare?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-String-Compare/m-p/181298#M52277</link>
      <description>&lt;P&gt;I misplaced where command. Sorry, already resolve.&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2015 02:28:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-String-Compare/m-p/181298#M52277</guid>
      <dc:creator>chengyu</dc:creator>
      <dc:date>2015-05-08T02:28:40Z</dc:date>
    </item>
  </channel>
</rss>

