Getting Data In

REST API - error "Invalid earliest_time."

jetzt82
Explorer

Use Splunk SDK JAVA, I'd use the REST API.
If the settings as follows causes an error.

code:

Args queryArgs = new Args();
queryArgs.put("earliest_time",  "8/21/2014:00:00:00");
queryArgs.put("latest_time",    "8/31/2014:23:59:59");

error:

[Fatal Error] :1:1: Unexpected end of file.
Exception in thread "main" com.splunk.HttpException: HTTP 400 -- <?xml version="1.0" encoding="UTF-8"?>
<response>
  <messages>
    <msg type="FATAL">Invalid earliest_time.</msg>
  </messages>
</response>

at com.splunk.HttpException.create(HttpException.java:84)
at com.splunk.HttpService.send(HttpService.java:386)
at com.splunk.Service.send(Service.java:1268)
at com.splunk.HttpService.post(HttpService.java:243)
at com.splunk.JobCollection.create(JobCollection.java:81)
at Test01_02.Test01_02_01.main(Test01_02_01.java:59)

Are there any workaround for this?

Tags (3)
0 Karma

sklass
Path Finder

In poking through the returned data - when it did work it looks like the format should be.

YYYY-MM-DDTHH:MM:SS

Example: 2015-05-02T07:30:00

You can also append your timezone at the end as well. Really this is way harder than it should be.

richgalloway
SplunkTrust
SplunkTrust

The format of the time strings don't look right. Have you tried "8/31/2014T00:00:00"?

---
If this reply helps you, Karma would be appreciated.
0 Karma

jetzt82
Explorer

queryArgs.put("earliest_time", "8/21/2014T00:00:00");
queryArgs.put("latest_time", "8/31/2014T23:59:59");

The same error occurs.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...