<?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 bug with eval + isnull and field name with a numeric first character? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/bug-with-eval-isnull-and-field-name-with-a-numeric-first/m-p/61094#M15060</link>
    <description>&lt;P&gt;hi, not sure if this is a bug or i am doing something wrong, I think it has something to do with a fieldname starting with a numeric.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval 24hour="1day" | eval test=if(isnull(24hour),"Yes","No")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;error: &lt;CODE&gt;Error in 'eval' command: The expression is malformed. Expected ).&lt;/CODE&gt;. If I rename the field to "hour24" it works without complaining...&lt;/P&gt;

&lt;P&gt;is there a restriction with using fieldnames that have a numeric as first character?&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2013 11:50:21 GMT</pubDate>
    <dc:creator>brettcave</dc:creator>
    <dc:date>2013-06-12T11:50:21Z</dc:date>
    <item>
      <title>bug with eval + isnull and field name with a numeric first character?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/bug-with-eval-isnull-and-field-name-with-a-numeric-first/m-p/61094#M15060</link>
      <description>&lt;P&gt;hi, not sure if this is a bug or i am doing something wrong, I think it has something to do with a fieldname starting with a numeric.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval 24hour="1day" | eval test=if(isnull(24hour),"Yes","No")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;error: &lt;CODE&gt;Error in 'eval' command: The expression is malformed. Expected ).&lt;/CODE&gt;. If I rename the field to "hour24" it works without complaining...&lt;/P&gt;

&lt;P&gt;is there a restriction with using fieldnames that have a numeric as first character?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 11:50:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/bug-with-eval-isnull-and-field-name-with-a-numeric-first/m-p/61094#M15060</guid>
      <dc:creator>brettcave</dc:creator>
      <dc:date>2013-06-12T11:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: bug with eval + isnull and field name with a numeric first character?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/bug-with-eval-isnull-and-field-name-with-a-numeric-first/m-p/61095#M15061</link>
      <description>&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Splunk only accepts field names that contain alpha-numeric characters or an underscore:

    Valid characters for field names are a-z, A-Z, 0-9, or _ .
    Field names cannot begin with 0-9 or _ . Leading underscores are reserved for Splunk's internal variables.
    International characters are not allowed. 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can force splunk to extract fields (through &lt;CODE&gt;REPORT&lt;/CODE&gt; in &lt;CODE&gt;props.conf&lt;/CODE&gt;) that start with a number or are all numeric, but there might be problems down the line, like you've experienced. I would not call it a bug, since it's rather well documented, but I understand it can be annoying.&lt;/P&gt;

&lt;P&gt;See the section on field extraction in &lt;CODE&gt;props.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/Admin/Propsconf"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/Admin/Propsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;See the &lt;CODE&gt;CLEAN_KEYS&lt;/CODE&gt; attribute in &lt;CODE&gt;transforms.conf&lt;/CODE&gt; as well.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/admin/Transformsconf"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/admin/Transformsconf&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CLEAN_KEYS = [true|false]
* NOTE: This attribute is only valid for search-time field extractions.
* Optional. Controls whether Splunk "cleans" the keys (field names) it extracts at search time. 
  "Key cleaning" is the practice of replacing any non-alphanumeric characters (characters other
  than those falling between the a-z, A-Z, or 0-9 ranges) in field names with underscores, as 
  well as the stripping of leading underscores and 0-9 characters from field names.
* Add CLEAN_KEYS = false to your transform if you need to extract field names that include 
  non-alphanumeric characters, or which begin with underscores or 0-9 characters.
* Defaults to true.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;K&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 12:22:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/bug-with-eval-isnull-and-field-name-with-a-numeric-first/m-p/61095#M15061</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-06-12T12:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: bug with eval + isnull and field name with a numeric first character?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/bug-with-eval-isnull-and-field-name-with-a-numeric-first/m-p/61096#M15062</link>
      <description>&lt;P&gt;thanks K, now stored in my internal reference for future use &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 13:00:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/bug-with-eval-isnull-and-field-name-with-a-numeric-first/m-p/61096#M15062</guid>
      <dc:creator>brettcave</dc:creator>
      <dc:date>2013-06-12T13:00:23Z</dc:date>
    </item>
  </channel>
</rss>

