<?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: REST API/Curl help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/REST-API-Curl-help/m-p/191929#M55230</link>
    <description>&lt;P&gt;Try single quotes around the percentage sign or escape double quotes&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval FS_PercUsed=rtrim(Use,'%')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval FS_PercUsed=rtrim(Use,\"%\")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 May 2015 13:03:26 GMT</pubDate>
    <dc:creator>Damien_Dallimor</dc:creator>
    <dc:date>2015-05-11T13:03:26Z</dc:date>
    <item>
      <title>REST API/Curl help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REST-API-Curl-help/m-p/191927#M55228</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a search that runs within Splunk, but when I try it via curl, I get an error.  Hoping someone can help me...&lt;/P&gt;

&lt;P&gt;Here's the command:&lt;/P&gt;

&lt;P&gt;curl -k -u user:passwd  --data-urlencode search="search index=coreops sourcetype=sitescope_monitorstat  MonitorType=FileSystem remotehost=artp17 OR remotehost=artp21 OR remotehost=artp22 OR remotehost=artp23 OR remotehost=artp24 OR remotehost=artp25 OR remotehost=artp26 AND (FS_Name = "/fii*" OR FS_Name = "/dis*") earliest=-15m |dedup remotehost, FS_Name |eval FS_PercUsed=rtrim(Use,"%")  |where FS_PercUsed &amp;gt; 50 |table _time, remotehost, FS_Name, FS_PercUsed"  &lt;A href="https://artp449:8089/servicesNS/admin/search/search/jobs/export" target="_blank"&gt;https://artp449:8089/servicesNS/admin/search/search/jobs/export&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;When I execute this, I get:&lt;BR /&gt;&lt;BR /&gt;
&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;BR /&gt;
&amp;lt;response&amp;gt;&amp;lt;messages&amp;gt;&amp;lt;msg type="FATAL"&amp;gt;Error in 'eval' command: The expression is malformed. An unexpected character is reached at '%)'.&amp;lt;/msg&amp;gt;&amp;lt;/messages&amp;gt;&amp;lt;/response&amp;gt;$ &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:56:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REST-API-Curl-help/m-p/191927#M55228</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2020-09-28T19:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: REST API/Curl help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REST-API-Curl-help/m-p/191928#M55229</link>
      <description>&lt;P&gt;It would be useful if you put the &lt;CODE&gt;curl&lt;/CODE&gt; line and XML response in a Code Sample block instead of the way you have here, but based on what is visible here, it looks like you're not escaping the double-quotes on the inside of the search string. That will almost certainly cause issues.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 12:59:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REST-API-Curl-help/m-p/191928#M55229</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-05-11T12:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: REST API/Curl help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REST-API-Curl-help/m-p/191929#M55230</link>
      <description>&lt;P&gt;Try single quotes around the percentage sign or escape double quotes&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval FS_PercUsed=rtrim(Use,'%')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval FS_PercUsed=rtrim(Use,\"%\")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 May 2015 13:03:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REST-API-Curl-help/m-p/191929#M55230</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2015-05-11T13:03:26Z</dc:date>
    </item>
  </channel>
</rss>

