<?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: Why does convert num NOT follow a universal typecasting paradigm and NOT trim leading zeroes? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-does-convert-num-NOT-follow-a-universal-typecasting-paradigm/m-p/429510#M122852</link>
    <description>&lt;P&gt;Check this please:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| makeresults | eval test=tonumber("06") | eval a=if(test="6","yes, splunk can cast to number","WHY")&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Sep 2019 17:10:51 GMT</pubDate>
    <dc:creator>diogofgm</dc:creator>
    <dc:date>2019-09-03T17:10:51Z</dc:date>
    <item>
      <title>Why does convert num NOT follow a universal typecasting paradigm and NOT trim leading zeroes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-convert-num-NOT-follow-a-universal-typecasting-paradigm/m-p/429506#M122848</link>
      <description>&lt;P&gt;I guess the question is a bit facetious&lt;/P&gt;

&lt;P&gt;But, I would still like to know what the (flawed) logic is behind this? It's like Splunk wants you to spend hours debugging or have poor data integrity.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval test="06" | convert num(test) | eval test="".test | eval a=if(test="6","yes","WHY")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Aug 2019 20:58:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-convert-num-NOT-follow-a-universal-typecasting-paradigm/m-p/429506#M122848</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2019-08-06T20:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why does convert num NOT follow a universal typecasting paradigm and NOT trim leading zeroes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-convert-num-NOT-follow-a-universal-typecasting-paradigm/m-p/429507#M122849</link>
      <description>&lt;P&gt;PS for anyone looking for a workaround, not an explanation (which is what I am looking for in an answer), you can just use tonumber or ltrim etc&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 21:05:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-convert-num-NOT-follow-a-universal-typecasting-paradigm/m-p/429507#M122849</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2019-08-06T21:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why does convert num NOT follow a universal typecasting paradigm and NOT trim leading zeroes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-convert-num-NOT-follow-a-universal-typecasting-paradigm/m-p/429508#M122850</link>
      <description>&lt;P&gt;See this version of your query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval test="06" | convert num(test) | eval test="".test | eval result1=if(test="6","just 6","NA") , result2=if(test="06", "zero padded 6", "NA"), result3=if(test=6,"number 6", "NA") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Aug 2019 21:47:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-convert-num-NOT-follow-a-universal-typecasting-paradigm/m-p/429508#M122850</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-08-20T21:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why does convert num NOT follow a universal typecasting paradigm and NOT trim leading zeroes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-convert-num-NOT-follow-a-universal-typecasting-paradigm/m-p/429509#M122851</link>
      <description>&lt;P&gt;ugh&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 22:20:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-convert-num-NOT-follow-a-universal-typecasting-paradigm/m-p/429509#M122851</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2019-08-20T22:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why does convert num NOT follow a universal typecasting paradigm and NOT trim leading zeroes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-convert-num-NOT-follow-a-universal-typecasting-paradigm/m-p/429510#M122852</link>
      <description>&lt;P&gt;Check this please:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| makeresults | eval test=tonumber("06") | eval a=if(test="6","yes, splunk can cast to number","WHY")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 17:10:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-convert-num-NOT-follow-a-universal-typecasting-paradigm/m-p/429510#M122852</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2019-09-03T17:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why does convert num NOT follow a universal typecasting paradigm and NOT trim leading zeroes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-convert-num-NOT-follow-a-universal-typecasting-paradigm/m-p/429511#M122853</link>
      <description>&lt;P&gt;Already noted in a comment on the question.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 18:27:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-convert-num-NOT-follow-a-universal-typecasting-paradigm/m-p/429511#M122853</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2019-09-03T18:27:58Z</dc:date>
    </item>
  </channel>
</rss>

