Dashboards & Visualizations

How to change events display format?

tejaldc
New Member

I have created a view with javascript to add search bar and display results as event list. How can I change the format in which the events are displayed? I want to use a userscript to format the way events are displayed

Labels (1)
Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

So, this is your javascript? How do you expect us to be able to tell you what you should change in your script? Can you at least share what you have in your script so far?

0 Karma

tejaldc
New Member

this is my script. it works fine right now, it will take in searches and display the results on the dashboard in the list form. however I want to change the format in which the list is displayed

require([
"splunkjs/mvc/searchmanager",
"splunkjs/mvc/searchbarview",
"splunkjs/mvc/searchcontrolsview",
"splunkjs/mvc/eventsviewerview",
"splunkjs/mvc/timelineview",
"splunkjs/mvc/simplexml/ready!"
], function(
SearchManager,
SearchbarView,
SearchControlsView,
EventsViewer,
TimelineView
) {

var mysearchbar = new SearchbarView({
id: "searchbar1",
managerid: "search1",
el: $("#mysearchbar1")
}).render();

var mysearchcontrols = new SearchControlsView({
id: "searchcontrols1",
managerid: "search1",
el: $("#mysearchcontrols1")
}).render();

var mytimeline = new TimelineView({
id: "timeline1",
managerid: "search1",
el: $("#mytimeline1")
}).render();

var mytable = new EventsViewer({
id: "table1",
managerid: "search1",
type: "list",
"list.drilldown": "outer",
drilldownRedirect: true,
"list.wrap": true,
count: 3,
pagerPosition: "top",
showPager: true,
rowNumbers: false,
el: $("#mytable1")
}).render();

var mysearch = new SearchManager({
id: "search1",
app: "search",
preview: true,
required_field_list: "*",
status_buckets: 300,
search: "index=_internal | head 100"
});

mytimeline.on("change", function() {
mysearch.settings.set(mytimeline.val());
});

mysearchbar.on("change", function() {
mysearch.settings.unset("search");
mysearch.settings.set("search", mysearchbar.val());
});

mysearchbar.timerange.on("change", function() {
mysearch.settings.set(mysearchbar.timerange.val());
});
});
0 Karma
Get Updates on the Splunk Community!

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

May 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

What's New in Splunk Observability Cloud and Splunk AppDynamics - May 2025

This month, we’re delivering several new innovations in Splunk Observability Cloud and Splunk AppDynamics ...