0

Java SDK を使用して Splunk に接続しようとしていますが、接続拒否例外が発生します。

     Map<String, Object> connectionArgs = new HashMap<String, Object>();
     connectionArgs.put("host", "mydomain.com");
     connectionArgs.put("username", "admin");
     connectionArgs.put("password", "passxxx");
     connectionArgs.put("port", 8089);
     connectionArgs.put("scheme", "https");
     Service splunkService = Service.connect(connectionArgs); 

上記の URL i、e、https: //mydomain.com でブラウザーを使用している場合、上記の資格情報でログインできますが、Java SDK 経由では接続できません。コードをデバッグしました。HttpService.java クラスでは、URL が https://mydomain.com:8089/services/auth/loginとして構築されています。

URLがこのように構築されている理由がわかりません。早期に問題を解決できるよう、ご協力をお願いいたします。ありがとう

4

2 に答える 2

0

SPLUNK SDK には厄介なバグがいくつかあります。BASH 経由で CURL を使用して、SPLUNK Rest API からデータを取得してみてください。複雑に見えますが、うまく機能します。開発とデバッグの時間を短縮できます。

次のスニペットはうまく機能します。

SPLUNK_API="https://splunk.you.de:8089/services/search"
curl -s -k -u user:password $SPLUNK_API/jobs -d output_mode=csv --data-urlencode 'search=search  sourcetype="tomcat-access.log"  RC>0  | timechart avg(runtime) by xyz ' -d earliest_time=$START_TIME -d latest_time=$END_TIME -d exec_mode=oneshot -o splunk-responsetime.csv
于 2013-11-19T15:42:02.330 に答える