All Apps and Add-ons

Illegal character in url_args

sylvainLuce
Explorer

Hi,

In my call in a browser, i send to a REST Url an arg like that :

$filter=Date%20eq%20datetime%272015-02-19T00:00:00%27

When I try to add the REST Call with the REST API Modular Input, it's the hell !
I have always an error like :

http_error_code = 400 error_message = {"error":{"code":"","message":{"lang":"en-US","value":"Syntax error: character '\\' is not valid at position 16 in 'Date eq datetime\\\"2015-02-22T00:00\\\"'."}}}

I try a lot of think like :

$filter=Date eq datetime\"2015-02-22T00:00\"

$filter=Date eq datetime"2015-02-22T00:00"

$filter=Date eq datetime'2015-02-22T00:00'

in the inputs.conf or in the web interface but without success 😞

Any ideas ?
Thanks !
Sylvain

Tags (1)
0 Karma

cpetterborg
SplunkTrust
SplunkTrust

Your browser is using a GET method when you put it in the URL. You need to provide a URL-ized string. Here is what you get when you make it URL-happy:

$ php
<?php
echo urlencode("filter=Date%20eq%20datetime%272015-02-19T00:00:00%27");
?>
filter%3DDate%2520eq%2520datetime%25272015-02-19T00%3A00%3A00%2527

I'm just guessing here, but I suspect you want to do something like:

http://machinename/API$filter%3DDate%2520eq%2520datetime%25272015-02-19T00%3A00%3A00%2527
0 Karma

Damien_Dallimor
Ultra Champion

In my call in a browser, i send to a REST Url an arg like that
$filter=Date%20eq%20datetime%272015-02-19T00:00:00%27

Can you be more accurate.....

What is the full HTTP REST URL in unencoded form that is expected to be sent ?

Any links to documentation for the particular REST API ?

0 Karma

sylvainLuce
Explorer

Hi,

the Rest API is in ODATA2 format.

Finally, I don't use the URL arg and put all the url in the Endpoint URL with a token to generate yesterday time.
It work 🙂

Thks

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...