All Apps and Add-ons

Is it possible to show the results table in a html module

adityapavan18
Contributor

Hi,

One way to show table results in HTML module..is by using row.cell0.name and row.cell1.name ..etc..,
But that can be done only if i know how many results i will get..

How to show all rows in table in HTML module when i dont know how many rows will be returned in table from search query?

sideview
SplunkTrust
SplunkTrust

The answer is simply - do not use the HTML module. Use the Table module in conjunction with the Pager module.

<module name="Pager">
  <module name="Table"></module>
</module>

That config above will render a paginated table for the search results, where each row of the search results is a row of the Table, and each field in the search result is a column of the Table. If you want to restrict the fields that show, you should either use the fields or table command in the search language. However Table also has a fields param as well as a hiddenFields param and these as well as much much more is described in the documentation inside Sideview Utils itself - "Module documentation > The Table Module > ..."

0 Karma

sideview
SplunkTrust
SplunkTrust

Yes it's quite easy. Ask that question instead, as a separate question here on answers. What I recommend is using a Checkbox module and a Switcher module and it's really quite easy. Trying to do this on your own with just the HTML module will be surprisingly difficult.

0 Karma

adityapavan18
Contributor

Hi Sideview
The reason i wanted it in HTML module is ..i want view have a toggle on/off on button to display the table or not..In my dashboard i have a HTML button which on clicking should toggle the table's visibility which is very easy...is there a way i can do the same to pager/table module

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...