<?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: return function on field with spaces in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305031#M166329</link>
    <description>&lt;P&gt;As already said by previous comments, correct solution would be to use spaceless names, but if you cannot change the field name, one workaround would be to add a    &lt;CODE&gt;rename&lt;/CODE&gt; command before the return&lt;/P&gt;

&lt;P&gt;Instead of having&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | return 10 "Name of Field"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You would have&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rename "Name of Field" as foo | return 10 foo
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 30 Aug 2017 08:19:44 GMT</pubDate>
    <dc:creator>fbehe</dc:creator>
    <dc:date>2017-08-30T08:19:44Z</dc:date>
    <item>
      <title>return function on field with spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305023#M166321</link>
      <description>&lt;P&gt;Hello - searched, but no answer found.&lt;/P&gt;

&lt;P&gt;...| return 10 "Name of Field"&lt;/P&gt;

&lt;P&gt;Gives: &lt;BR /&gt;
Name="" of="" Field="" &lt;/P&gt;

&lt;P&gt;I know that I can rename this field, but the goal is to get the actual correct name with spaces as it is used in another sourcetype with the same format.&lt;/P&gt;

&lt;P&gt;Any ideas please?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 17:55:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305023#M166321</guid>
      <dc:creator>kwanx</dc:creator>
      <dc:date>2017-08-29T17:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: return function on field with spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305024#M166322</link>
      <description>&lt;P&gt;Have you tried using single quotes around the field name?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 18:34:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305024#M166322</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-08-29T18:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: return function on field with spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305025#M166323</link>
      <description>&lt;P&gt;yes, simiar results &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 19:05:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305025#M166323</guid>
      <dc:creator>kwanx</dc:creator>
      <dc:date>2017-08-29T19:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: return function on field with spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305026#M166324</link>
      <description>&lt;P&gt;Not sure if it's a bug/limitation/design, but return command only accepts fields with clean names (no spaces). The workaround would be like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| head 10 | table "Name of Field" | format
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Aug 2017 20:00:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305026#M166324</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-29T20:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: return function on field with spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305027#M166325</link>
      <description>&lt;P&gt;maybe so; that yields:&lt;/P&gt;

&lt;P&gt;( ( "Name=\"\" of=\"\" Field=\"\"" ) ) &lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 20:18:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305027#M166325</guid>
      <dc:creator>kwanx</dc:creator>
      <dc:date>2017-08-29T20:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: return function on field with spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305028#M166326</link>
      <description>&lt;P&gt;Try this runanywhere search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-10 | eval "Name of field"=starttime | table "Name of field" | format
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( ( "Name of field"="1503118800" ) OR ( "Name of field"="1503205200" ) OR ( "Name of field"="1503291600" ) OR ( "Name of field"="1503378000" ) OR ( "Name of field"="1503464400" ) OR ( "Name of field"="1503550800" ) OR ( "Name of field"="1503637200" ) OR ( "Name of field"="1503723600" ) OR ( "Name of field"="1503810000" ) OR ( "Name of field"="1503896400" ) ) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Aug 2017 20:36:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305028#M166326</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-29T20:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: return function on field with spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305029#M166327</link>
      <description>&lt;P&gt;I do not believe that this can be; even so, it would be best if you didn't.&lt;/P&gt;

&lt;P&gt;Best Practice: Do not use field names with spaces.&lt;BR /&gt;
Even Better Practice: Only use "clean" names:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Transformsconf#Clean_keys"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Admin/Transformsconf#Clean_keys&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 02:31:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305029#M166327</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-08-30T02:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: return function on field with spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305030#M166328</link>
      <description>&lt;P&gt;@kwanx, what is your use case? What are you trying to do? It would be possible for us to suggest alternative if you can share complete SPL.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 06:48:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305030#M166328</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-08-30T06:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: return function on field with spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305031#M166329</link>
      <description>&lt;P&gt;As already said by previous comments, correct solution would be to use spaceless names, but if you cannot change the field name, one workaround would be to add a    &lt;CODE&gt;rename&lt;/CODE&gt; command before the return&lt;/P&gt;

&lt;P&gt;Instead of having&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | return 10 "Name of Field"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You would have&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rename "Name of Field" as foo | return 10 foo
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Aug 2017 08:19:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305031#M166329</guid>
      <dc:creator>fbehe</dc:creator>
      <dc:date>2017-08-30T08:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: return function on field with spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305032#M166330</link>
      <description>&lt;P&gt;Can I pass that 10 from a count? I mean say suppose I have this command stats count as count which gives me 10. How I do write the return query-&amp;gt; &lt;/P&gt;

&lt;P&gt;|return count foo&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 15:36:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/return-function-on-field-with-spaces/m-p/305032#M166330</guid>
      <dc:creator>tchintam</dc:creator>
      <dc:date>2018-06-07T15:36:32Z</dc:date>
    </item>
  </channel>
</rss>

