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
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.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 ...