<?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 convert number to string using tostring function? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681636#M232929</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254242"&gt;@LearningGuy&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;As I said, using 1000 instead of 1 you have a string.&lt;/P&gt;&lt;P&gt;I don't know why with a different number you have a different type.&lt;/P&gt;&lt;P&gt;You eventually could to try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval num = 1 
| eval var_type = typeof(num)
| eval num2 = tostring(num,"commas")." "
| eval var_type2 = typeof(num2)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2024 05:33:11 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2024-03-22T05:33:11Z</dc:date>
    <item>
      <title>how to convert number to string using tostring function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681565#M232900</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;how to convert number to string using tostring function?&lt;BR /&gt;I tried using &lt;STRONG&gt;tostring&lt;/STRONG&gt; function, but the result is still number&lt;BR /&gt;See below.&amp;nbsp; &amp;nbsp;Thank you!!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults

| eval num = 1
| eval var_type = typeof('num')

| eval num2 = tostring(num)
| eval var_type2 = typeof('num2')&lt;/LI-CODE&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="LearningGuy_0-1711035209226.png" style="width: 721px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29838iCC195D4D279CDE06/image-dimensions/721x69?v=v2" width="721" height="69" role="button" title="LearningGuy_0-1711035209226.png" alt="LearningGuy_0-1711035209226.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 15:35:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681565#M232900</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2024-03-21T15:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert number to string using tostring function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681567#M232901</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254242"&gt;@LearningGuy&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;see at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SCS/current/SearchReference/ConversionFunctions" target="_blank"&gt;https://docs.splunk.com/Documentation/SCS/current/SearchReference/ConversionFunctions&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval num = 1
| eval var_type = typeof('num')
| eval num2 = tostring(num, "commas")
| eval var_type2 = typeof('num2')&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 15:40:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681567#M232901</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-21T15:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert number to string using tostring function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681569#M232902</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;I tried and the same result..&amp;nbsp; see below..&amp;nbsp; thank you&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LearningGuy_0-1711035919488.png" style="width: 656px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29839i30662818CE33E32A/image-dimensions/656x264?v=v2" width="656" height="264" role="button" title="LearningGuy_0-1711035919488.png" alt="LearningGuy_0-1711035919488.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 15:45:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681569#M232902</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2024-03-21T15:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert number to string using tostring function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681570#M232903</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254242"&gt;@LearningGuy&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;what does it happen running:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval num = 1000
| eval var_type = typeof("num")
| eval num2 = tostring(num, "commas")
| eval var_type2 = typeof("num2")&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 15:48:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681570#M232903</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-21T15:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert number to string using tostring function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681573#M232904</link>
      <description>&lt;P&gt;They both became String.&amp;nbsp; &amp;nbsp; &amp;nbsp;Num should be number.&amp;nbsp; Thanks&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LearningGuy_0-1711036391407.png" style="width: 649px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29840i3E7886E26188E0E0/image-dimensions/649x271?v=v2" width="649" height="271" role="button" title="LearningGuy_0-1711036391407.png" alt="LearningGuy_0-1711036391407.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 15:54:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681573#M232904</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2024-03-21T15:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert number to string using tostring function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681574#M232905</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254242"&gt;@LearningGuy&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the second it's a string, you transformed it using the tostring function, infact you have the commas.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 15:56:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681574#M232905</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-21T15:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert number to string using tostring function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681578#M232906</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Yes but why the first one is also string?&lt;BR /&gt;The first one is number.&lt;BR /&gt;Should I remove " " from typeof?&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thanks&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval num = 1 
| eval var_type = typeof(num)
| eval num2 = tostring("num")
| eval var_type2 = typeof(num2)&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LearningGuy_0-1711036912855.png" style="width: 606px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29841iA435305632A53C26/image-dimensions/606x241?v=v2" width="606" height="241" role="button" title="LearningGuy_0-1711036912855.png" alt="LearningGuy_0-1711036912855.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 16:02:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681578#M232906</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2024-03-21T16:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert number to string using tostring function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681579#M232907</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254242"&gt;@LearningGuy&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as I said, you have to say what kind of string you want:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval num = 1 
| eval var_type = typeof(num)
| eval num2 = tostring(num,"commas")
| eval var_type2 = typeof(num2)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 16:05:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681579#M232907</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-21T16:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert number to string using tostring function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681592#M232909</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Sorry.. I tried again your last suggestion, but &lt;STRONG&gt;num&lt;/STRONG&gt; and &lt;STRONG&gt;num2&lt;/STRONG&gt; still have type as &lt;EM&gt;&lt;STRONG&gt;"Number"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;I expect &lt;STRONG&gt;num2&lt;/STRONG&gt; has &lt;EM&gt;&lt;STRONG&gt;"String"&lt;/STRONG&gt; &lt;/EM&gt;type after using&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;num2&lt;/STRONG&gt;= &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;EM&gt;tostring&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;(&lt;STRONG&gt;num&lt;/STRONG&gt;,"commas")&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Please suggest&amp;nbsp; &amp;nbsp;Thanks again..&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LearningGuy_0-1711042200468.png" style="width: 718px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29847iE6955E466E71195F/image-dimensions/718x289?v=v2" width="718" height="289" role="button" title="LearningGuy_0-1711042200468.png" alt="LearningGuy_0-1711042200468.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 17:32:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681592#M232909</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2024-03-21T17:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert number to string using tostring function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681636#M232929</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254242"&gt;@LearningGuy&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;As I said, using 1000 instead of 1 you have a string.&lt;/P&gt;&lt;P&gt;I don't know why with a different number you have a different type.&lt;/P&gt;&lt;P&gt;You eventually could to try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval num = 1 
| eval var_type = typeof(num)
| eval num2 = tostring(num,"commas")." "
| eval var_type2 = typeof(num2)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 05:33:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/681636#M232929</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-22T05:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert number to string using tostring function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/693361#M235918</link>
      <description>&lt;P&gt;It's a bit older but it seems to be some confusion around:&lt;/P&gt;&lt;P&gt;Your second example is completely different from the first one as you use double quotes, i.e.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval var_type = typeof("num")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"num" is a literal string which has nothing to do with your variable! Take care about using double quotes (for strings), single quotes (for field names, e.g. containing spaces (for whatever reason... &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; )) or no quotes at all (also for field names).&lt;/P&gt;&lt;P&gt;Besides that to me it seems that this `tostring` function is buggy. If I convert any number using `tostring(number)` that should(!) become a string, regardless of any "format"-argument. And the "typeof()" function should then return "String" for this string.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto_2024-07-15_11-33-23.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/31758i76FA951349D0B4D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bildschirmfoto_2024-07-15_11-33-23.png" alt="Bildschirmfoto_2024-07-15_11-33-23.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 09:35:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-convert-number-to-string-using-tostring-function/m-p/693361#M235918</guid>
      <dc:creator>rvany</dc:creator>
      <dc:date>2024-07-15T09:35:37Z</dc:date>
    </item>
  </channel>
</rss>

