<?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: sub search does not return string on splunk 8.1.4 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/sub-search-does-not-return-string-on-splunk-8-1-4/m-p/582734#M202946</link>
    <description>&lt;P&gt;Wow! Thank you very much for quick and perfect answer! It works fine!&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jan 2022 12:00:18 GMT</pubDate>
    <dc:creator>kiyoshi_miyake</dc:creator>
    <dc:date>2022-01-27T12:00:18Z</dc:date>
    <item>
      <title>sub search does not return string on splunk 8.1.4</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sub-search-does-not-return-string-on-splunk-8-1-4/m-p/582709#M202942</link>
      <description>&lt;P&gt;I get number from subsearch but get null for string like below on splunk 8.1.4.&lt;BR /&gt;I found the splunk answer that resolved by appending "format", but it is not resolved for me. Is it bug on 8.x?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="subsearch_issue.PNG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17711i54ED42E89A7D12E9/image-size/large?v=v2&amp;amp;px=999" role="button" title="subsearch_issue.PNG" alt="subsearch_issue.PNG" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;| makeresults&lt;BR /&gt;| eval foo = [ | makeresults | eval foo="123" | return $foo ]&lt;BR /&gt;| eval bar = [ | makeresults | eval bar="bar" | return $bar ]&lt;BR /&gt;| eval baz = tostring([ | makeresults | eval baz="baz" | return $baz ])&lt;BR /&gt;| eval qux = tostring([ | makeresults | eval qux="qux" | return $qux | format ])&lt;BR /&gt;| table _time foo bar baz qux&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 09:51:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sub-search-does-not-return-string-on-splunk-8-1-4/m-p/582709#M202942</guid>
      <dc:creator>kiyoshi_miyake</dc:creator>
      <dc:date>2022-01-27T09:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: sub search does not return string on splunk 8.1.4</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sub-search-does-not-return-string-on-splunk-8-1-4/m-p/582722#M202945</link>
      <description>&lt;P&gt;If you expand the query (&amp;lt;ctrl&amp;gt;&amp;lt;shift&amp;gt;E) you get this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval foo = 123 
| eval bar = bar 
| eval baz = tostring( baz ) 
| eval qux = tostring( ( ( qux ) ) ) 
| table _time foo bar baz qux&lt;/LI-CODE&gt;&lt;P&gt;Which explains all the null and empty fields&lt;/P&gt;&lt;P&gt;You can (almost) fix this by providing arguments to the format command - the result (if not numeric) still needs trimming&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval foo = [ | makeresults | eval foo="123" | return $foo ]
| eval bar = trim([ | makeresults | eval bar="bar" | return $bar | format "\"" "" "" "" "" "\"" ])
| eval baz = tostring(trim([ | makeresults | eval baz="baz" | return $baz | format "\"" "" "" "" "" "\"" ]))
| eval qux = tostring(trim([ | makeresults | eval qux="qux" | return $qux | format "" "\"" "" "\"" "" "" ]))
| table _time foo bar baz qux&lt;/LI-CODE&gt;&lt;P&gt;Giving&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITWhisperer_0-1643280109814.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17714iA6CEA43045BB760B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITWhisperer_0-1643280109814.png" alt="ITWhisperer_0-1643280109814.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITWhisperer_1-1643280151197.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17715iCF6C74249953A006/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITWhisperer_1-1643280151197.png" alt="ITWhisperer_1-1643280151197.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 10:42:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sub-search-does-not-return-string-on-splunk-8-1-4/m-p/582722#M202945</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-01-27T10:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: sub search does not return string on splunk 8.1.4</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sub-search-does-not-return-string-on-splunk-8-1-4/m-p/582734#M202946</link>
      <description>&lt;P&gt;Wow! Thank you very much for quick and perfect answer! It works fine!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 12:00:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sub-search-does-not-return-string-on-splunk-8-1-4/m-p/582734#M202946</guid>
      <dc:creator>kiyoshi_miyake</dc:creator>
      <dc:date>2022-01-27T12:00:18Z</dc:date>
    </item>
  </channel>
</rss>

