Dashboards & Visualizations

Django(HTML)で作成したダッシュボードからCSV出力を行いたい

pisc
Explorer

サーチバーで検索した結果を出力したものをCSV出力する方法を教えてください。

Django(HTML + JavaScript)にてAppを作成してダッシュボードを作成しました。
サーチバーに入力したものをテーブルビューで出力するシンプルなダッシュボードです。

Advanced XMLであればを使用して結果を出力するボタンを作成することが出来ますが、Django(html)では作成することは可能でしょうか。
イメージはデフォルトで付属しているSearch.appで検索後、「スマートモード」の左隣にあるボタン群のようなものです。

Advanced XMLは「?showsource=true」でソースを確認してもXMLしか表示されず、
ブラウザ付属の「ソースを表示」を使用しても検索前(ボタン群が表示されていない)のソースしか表示されません。

以上、よろしくお願いします。

0 Karma

bananaman
Path Finder

Hi,

I have got sample HTML code from our colleague.
Please see the github link he created.

https://gist.github.com/mgroves84/d2a4e8ac91e8b6a6e86c

Please add this page to within the /django/templates/ directory for your test.

Thank you.

0 Karma

gburgett_splunk
Splunk Employee
Splunk Employee

Under the covers the export button calls the /en-US/api/search/jobs//results?isDownload=true endpoint. I’ve included an example of the full call below. Also see the docs on the job results endpoint.

http://127.0.0.1:8000/en-US/api/search/jobs/1395156402.45/results?isDownload=true&timeFormat=%25FT%2...

You would have to write some JS code to get the search_id from the search manager and then call the API endpoint to get the file.

I don’t have any sample code, but hopefully that will get you started.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...