All Apps and Add-ons

Exporting results displayed using html module from csv file

madanashok
Path Finder

Hi,

I have a query that is fetching the results from csv file based on the condition in query and displaying using html module.

Now I have to export the results displayed using html module in the same format as how it looks to excel sheet.

Is there any way possible to do it.

If so, please help me.

Thanks,
Madan

sideview
SplunkTrust
SplunkTrust

Well, you're using the HTML module which means you're using Sideview Utils. Sideview Utils has another module called SearchControls. (At least it does if you're using the latest version of Utils from the sideview site rather than the older version from Splunkbase. )

The SearchControls module then allows you to put a little export button into your view. Technically SearchControls has all kinds of buttons, menus and controls, but you can tell it exactly which ones you want, and if you only want export you just configure it with <param name="sections">export</param>.

Anyway, with that button your users can export the current search results, with all the rows in there and with all the fields those rows have, to a CSV file which you save locally. And you can then open the CSV file in Excel.

However, if the results that you want to export are in a table, and you're displaying those results in an HTML module.... Then this suggests that you are using the HTML module to display a big table? Which is a weird thing to do. If that's the case you'd be better off using a SimpleResultsTable module with a Pager module.

And if it has some rows that you wouldn't want to export, modify your search or just use the PostProcess module. And if it has fields that you don't want to export the simplest solution is to just use the fields command, again in your Search or in PostProcess.

At any rate, I hope this answer helps.

As dart mentioned, there is also the Splunk for Excel Export app. With that you can put another excel button on the page. The advantage over the normal export buttons is that the one from the excel app will actually trigger Excel to open directly to receive the file from Splunk. Mostly this means you just wont have to temporarily save a CSV file and then open it later.

dart
Splunk Employee
Splunk Employee

Does the Excel Export app help out here?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

ATTENTION: We’re Moving! (AGAIN!)

The Splunk Community Slack is undergoing a system migration to keep our workspace secure and ...

Deep Dive: Optimizing Telemetry Pipelines in Splunk Observability Cloud

In this session, we will peel back the layers of Splunk Observability Cloud’s cost-optimization features. ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...