<?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 stop Splunk from recognizing a large number as a (epoch) timestamp? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352339#M104265</link>
    <description>&lt;P&gt;Try using &lt;CODE&gt;...| eval Identifier2=\"$ID2$\" | table Identifier2&lt;/CODE&gt; in your map search to treat this a string, instead of number. Since it's a very large number Splunk might be rounding it to contain within Splunk limit.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Apr 2018 15:12:44 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-04-23T15:12:44Z</dc:date>
    <item>
      <title>How to stop Splunk from recognizing a large number as a (epoch) timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352338#M104264</link>
      <description>&lt;P&gt;I'm using the map function to do a search on reach row of a table I've created with some IDs that link certain things together in the system/process I am trying to analyze.&lt;BR /&gt;
The table holds 4 columns: ID1, Time1, ID2, Time2&lt;BR /&gt;
When I pass these values to the map function as &lt;CODE&gt;$ID1$&lt;/CODE&gt; etc. they all work fine except for ID2 which is a large number prefixed by "RT".&lt;BR /&gt;
e.g. RT201804171037017795. This kept showing up as "null" in the resulting events and hence lead to problems.&lt;BR /&gt;
I realized that this "RT" means it might get recognized as a real time search value hence I trimmed the RT using the trim() function: &lt;CODE&gt;trim(ID2, "RT")&lt;/CODE&gt;. So far so good.&lt;/P&gt;

&lt;P&gt;However, now when I parse the number to the map function as &lt;CODE&gt;$ID2$&lt;/CODE&gt; and use it's value as a table field &lt;CODE&gt;...| eval Identifier2=$ID2$ | table Identifier2 | ...&lt;/CODE&gt;  The resulting field is &lt;EM&gt;not&lt;/EM&gt; 201804171037017795 but 201804171037017800. Because the number is so large I thougth it might be recognized as an Epoch time. This is probably the case as both 2018041710370177 and 2018041710370178 result in the same Epoch time (recognized as microseconds - according to epochconverter): Monday 12 December 2033 23:08:30.370.&lt;/P&gt;

&lt;P&gt;Hence, the reason the number is rounded up is &lt;EM&gt;likely&lt;/EM&gt; because Splunk thinks I'm giving it an Epoch time while it is simply a large identifier. Thus, my question (finally) is: How do I stop Splunk from recognizing this large number as a timestamp? I want to explicitly tell Splunk it is just a &lt;EM&gt;number&lt;/EM&gt; or even a &lt;EM&gt;string&lt;/EM&gt; and the value does &lt;EM&gt;not&lt;/EM&gt; matter. It should be parsed as a string only for identification.&lt;/P&gt;

&lt;P&gt;I've already tried &lt;CODE&gt;toString(ID2)&lt;/CODE&gt; to no avail.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;TL;DR&lt;/STRONG&gt;: How to specifically tell Splunk how to handle a (large) value as a string/number and &lt;EM&gt;not&lt;/EM&gt; as an Epoch time?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 08:26:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352338#M104264</guid>
      <dc:creator>koenV</dc:creator>
      <dc:date>2018-04-23T08:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop Splunk from recognizing a large number as a (epoch) timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352339#M104265</link>
      <description>&lt;P&gt;Try using &lt;CODE&gt;...| eval Identifier2=\"$ID2$\" | table Identifier2&lt;/CODE&gt; in your map search to treat this a string, instead of number. Since it's a very large number Splunk might be rounding it to contain within Splunk limit.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 15:12:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352339#M104265</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-04-23T15:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop Splunk from recognizing a large number as a (epoch) timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352340#M104266</link>
      <description>&lt;P&gt;I'm not sure the problem is what you think it is. I tried this test:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval f1="RT201804171037017795", f2=trim(f1, "RT") 
| map 
    [| stats count 
    | eval sub_f1="$f1$", sub_f2="$f2$"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get back exactly what I'd expect - the values fed through. Maybe something else is causing the issue. Can you describe the source data and search approach? &lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 15:25:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352340#M104266</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-23T15:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop Splunk from recognizing a large number as a (epoch) timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352341#M104267</link>
      <description>&lt;P&gt;Try this (no double quotes in sub_f2)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
 | eval f1="RT201804171037017795", f2=trim(f1, "RT") 
 | map 
     [| stats count 
     | eval sub_f1="$f1$", sub_f2=$f2$]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Apr 2018 15:45:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352341#M104267</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-04-23T15:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop Splunk from recognizing a large number as a (epoch) timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352342#M104268</link>
      <description>&lt;P&gt;I stand corrected!&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 18:24:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352342#M104268</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-23T18:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop Splunk from recognizing a large number as a (epoch) timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352343#M104269</link>
      <description>&lt;P&gt;Just using &lt;CODE&gt;"$ID1$"&lt;/CODE&gt; instead of &lt;CODE&gt;$ID1$&lt;/CODE&gt; did the trick....&lt;BR /&gt;
Never knew this was a way to tell Splunk a field is a string. Are there more 'tricks' like this, and do you have a reference for it?&lt;/P&gt;

&lt;P&gt;Thanks for the help both of you! Can't accept a comment as an answer sadly; i.e. if one of you could answer the question i'll accept it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 09:40:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352343#M104269</guid>
      <dc:creator>koenV</dc:creator>
      <dc:date>2018-04-25T09:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop Splunk from recognizing a large number as a (epoch) timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352344#M104270</link>
      <description>&lt;P&gt;Within your map subsearch, wrap your reference to the variable in double-quotes, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval f1="RT201804171037017795", f2=trim(f1, "RT") 
| map 
    [| stats count 
    | eval sub_f1="$f1$", sub_f2="$f2$"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will force Splunk to treat the contents of what you're passing into the subsearch as a string (preserving all of it), and then you can convert it back to a number within the context of the subsearch.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 14:27:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-stop-Splunk-from-recognizing-a-large-number-as-a-epoch/m-p/352344#M104270</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-25T14:27:37Z</dc:date>
    </item>
  </channel>
</rss>

