Splunk Search

Prevent users from table sorting (when clicking on its headers)

kikexclusive
Path Finder

The question is really simple, not that sure about the answer though. I'm using Splunk 5.0.6 + Advanced XML panels to render my results in a Table. I would like to know if it's possible to disable the default option of sorting the table when the user clicks on one of the table header fields.

In other words, I don't want the user to be able to modify the way the table has been rendered after the webpage loads.

Cheers!

jadengoho
Builder

You can do this using CSS

 <panel depends="$hide$">
      <html>
        <style>
i.icon-sorts {display: none;}
th { pointer-events: none;}
        </style>
      </html>
    </panel>

sideview
SplunkTrust
SplunkTrust

Note - this answer is only relevant for the simple XML and is not relevant at all to the Advanced XML or the Sideview XML.

And this question is explicitly about how to do this in the Sideview XML.

0 Karma

jadengoho
Builder

okay - other users can use this though on Simple XML

0 Karma

sideview
SplunkTrust
SplunkTrust

There's no way to do this currently in the Sideview Table module. However it's an easy feature to add and you're the second or third customer to ask for it, so it has been added. It will go out in the next release which should be in a week or two.

How it works is there will be a new optional param called "allowSorting". 99% of the time you will leave it blank and you'll get the current behavior with the clickable column headers and arrows etc. If you set <param>False, then the column headers will not be clickable and wont have little arrows.

If you really need a short term hack and you're somewhat comfortable in Javascript and able to edit application.js, you could explore using a customBehavior param on the Table, and defining in your customBehavior that the "onSortClick" method should do nothing at all.

BeautyData
Engager

I try today with  that "allowSorting"false in my json code and is not working. Share my code:

{
    "type""splunk.table",
    "dataSources": {
        "primary""ds_z5csywhv"
    },
    "title""Hits",
    "description""Daily",
    "options": {
        "columnFormat": {
            "Daily_Hits": {
                "width"65,
                "align": [
                    "center"],
                "allowSorting": false
            }
        },
        "tableFormat": {
            "headerBackgroundColor""#FFA476",
            "headerColor""#772800"            
        },
        "count"5,
        "fontSize""small",
        "font""proportional",
        "showRowNumbers"true        
    },
    "context": {},
    "showProgressBar"false,
    "showLastUpdated"false
}
0 Karma

sideview
SplunkTrust
SplunkTrust

Just to confirm - this feature did go out, just as described above, in Sideview Utils 3.3.3. If you can't find it, just upgrade. Release notes are here - http://sideviewapps.com/apps/sideview-utils/release-notes/

And if you go to Manage Apps and you're confused because Splunk tells you have 1.3.5 and 1.3.5 is the most recent version, that's because you can only get Sideview Utils from the sideview website. Latest is 3.3.6 and you can download for free by clicking the "download full version" link on the following page: http://sideviewapps.com/apps/sideview-utils/

0 Karma

kikexclusive
Path Finder

Thanks a lot for letting me know ! Your help is always very useful

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...