<?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 Using rest with eval in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-rest-with-eval/m-p/153949#M43245</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;is there a possibility to use the |rest command with an eval like:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;anysearch&lt;/CODE&gt;&lt;BR /&gt;
|eval test = [rest /services/authentication/current-context &lt;BR /&gt;
|rename username as user|return $user]&lt;/P&gt;

&lt;P&gt;With this search I just get an empty field test. But why?&lt;BR /&gt;
Greetings&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jul 2014 12:28:47 GMT</pubDate>
    <dc:creator>C_Sparn</dc:creator>
    <dc:date>2014-07-23T12:28:47Z</dc:date>
    <item>
      <title>Using rest with eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-rest-with-eval/m-p/153949#M43245</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;is there a possibility to use the |rest command with an eval like:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;anysearch&lt;/CODE&gt;&lt;BR /&gt;
|eval test = [rest /services/authentication/current-context &lt;BR /&gt;
|rename username as user|return $user]&lt;/P&gt;

&lt;P&gt;With this search I just get an empty field test. But why?&lt;BR /&gt;
Greetings&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jul 2014 12:28:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-rest-with-eval/m-p/153949#M43245</guid>
      <dc:creator>C_Sparn</dc:creator>
      <dc:date>2014-07-23T12:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using rest with eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-rest-with-eval/m-p/153950#M43246</link>
      <description>&lt;P&gt;Use it like this (run anywhere code). You're extracting string and its need to be within double quotes for eval to work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats count |eval test = [|rest /services/authentication/current-context |eval user="\"".username."\""|return $user]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Jul 2014 12:36:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-rest-with-eval/m-p/153950#M43246</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-23T12:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using rest with eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-rest-with-eval/m-p/153951#M43247</link>
      <description>&lt;P&gt;WOW!&lt;BR /&gt;
Thank you very much. That solved the problem.&lt;BR /&gt;
Another possibility is to use: &lt;BR /&gt;
"+" instead of "." in the eval&lt;BR /&gt;
Greetings&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jul 2014 12:43:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-rest-with-eval/m-p/153951#M43247</guid>
      <dc:creator>C_Sparn</dc:creator>
      <dc:date>2014-07-23T12:43:23Z</dc:date>
    </item>
  </channel>
</rss>

