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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...