Refine your search:

0
1

I have a custom app defined. I want to query a macro defined in it. The samples provided here (http://code.google.com/p/splunk-java-sdk/w/list) call splunk's search app by default. How do I get it to call my custom app instead?

asked 24 Jan '10, 23:52

dinh's gravatar image

dinh
19019
accept rate: 33%

edited 25 Jan '10, 18:55

Johnvey's gravatar image

Johnvey ♦♦
2.1k217


3 Answers:

It looks like this was answered in another post. The trick is to instead of sending it to the following path:

POST https://splunkserver.local:8089/services/search/jobs

Send it to

POST https://splunkserver:8089/servicesNS/YOUR_USERNAME/TARGET_NAMESPACE/search/jobs
link

answered 03 Feb '10, 19:40

dinh's gravatar image

dinh
19019
accept rate: 33%

If you are using the SDK from the current source, you can specify an optional namespace parameter when dispatching a job to target a specific app. See the inline docs here:

http://code.google.com/p/splunk-java-sdk/source/browse/trunk/SplunkSDK/src/com/splunk/sdk4x/search/JobParameters.java

Note that the SDK is not considered stable for 4.0. Read more about Splunk's SDKs and APIs.

link

answered 25 Jan '10, 18:17

Johnvey's gravatar image

Johnvey ♦♦
2.1k217
accept rate: 60%

I set the namespace in the my job parameters and I see it go out on the POST, but it is still not working. I get the same error as before which is that it could not find the macro. I'm wondering if the REST api is even looking at the namespace parameter.

(25 Jan '10, 22:53) dinh

We are currently building out a new Java SDK. It will be available on GitHub. I can give pre-release access - just need a GitHub ID.

Any questions - psanford@splunk.com or ping us on Twitter: @splunkdev

link

answered 28 Sep '11, 10:10

psanford_splunk's gravatar image

psanford_splunk
1291
accept rate: 10%

Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×211
×16

Asked: 24 Jan '10, 23:52

Seen: 894 times

Last updated: 28 Sep '11, 10:10

Copyright © 2005-2012 Splunk, Inc. All rights reserved.