Skip to content

Commit 5c3b0f0

Browse files
committed
Update example_customtables.js
Fixing a bug where the script to populate the list of workflows was automatically overwriting the events used in the conclusions over time panel. Changed search name to avoid this.
1 parent 7100d15 commit 5c3b0f0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

github_app_for_splunk/appserver/static/example_customtables.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,22 @@ require([
1111
TableView
1212
) {
1313

14+
mvc.Components.revokeInstance("myCustomRowSearch");
15+
1416
// Set up search managers
15-
var search2 = new SearchManager({
16-
id: "search2",
17+
var myCustomRowSearch = new SearchManager({
18+
id: "myCustomRowSearch",
1719
preview: true,
1820
cache: true,
1921
search: "`github_webhooks` \"workflow_run.name\"=\"*\" | spath \"repository.full_name\" | search repository.full_name=* | eval started=if(action=\"requested\",_time,NULL), completed=if(action=\"completed\",_time, NULL), created=round(strptime('workflow_run.created_at',\"%Y-%m-%dT%H:%M:%SZ\")) | stats latest(created) as created, latest(started) as started, latest(completed) as completed, latest(duration) as duration, latest(workflow_run.conclusion) as workflow_run.conclusion by repository.full_name,workflow_run.name,workflow_run.id | eval started=if(isnull(started), created, started) | eval duration=if(isnotnull(completed),tostring(completed-started,\"Duration\"),\"In Progress\") | rename workflow_run.conclusion as status, repository.full_name as \"Repository Name\", workflow_run.name as \"Workflow Name\", workflow_run.id as \"Run ID\" | table status, \"Repository Name\", \"Workflow Name\", \"Run ID\", duration,completed|sort completed|fields - completed",
20-
earliest_time: mvc.tokenSafe("$field1.earliest$"),
21-
latest_time: mvc.tokenSafe("$field1.latest$")
22+
earliest_time: mvc.tokenSafe("$timeTkn.earliest$"),
23+
latest_time: mvc.tokenSafe("$timeTkn.latest$")
2224
});
2325

2426
// Create a table for a custom row expander
2527
var mycustomrowtable = new TableView({
2628
id: "table-customrow",
27-
managerid: "search2",
29+
managerid: "myCustomRowSearch",
2830
drilldown: "none",
2931
drilldownRedirect: false,
3032
el: $("#table-customrow")

0 commit comments

Comments
 (0)