Skip to content

Commit 02c408c

Browse files
authored
Merge pull request #4 from gjanders/testing2
Testing2
2 parents 768daf6 + e04c3d7 commit 02c408c

File tree

4 files changed

+219
-2
lines changed

4 files changed

+219
-2
lines changed

SplunkVersionControl.tgz

-14.4 KB
Binary file not shown.

default/app.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ label = SplunkVersionControl
1212
[launcher]
1313
author = Gareth Anderson
1414
description = Version Control software for Splunk instances (backup/restore from git)
15-
version = 0.0.1
15+
version = 0.0.4
1616

1717
[package]
1818
id = SplunkVersionControl
19-
check_for_updates = true
19+
check_for_updates = true
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<form>
2+
<label>Knowledge Objects By App</label>
3+
<description>List of knowledge objects per app</description>
4+
<fieldset submitButton="false">
5+
<input type="dropdown" token="app">
6+
<label>Application Name</label>
7+
<fieldForLabel>app</fieldForLabel>
8+
<fieldForValue>app</fieldForValue>
9+
<search>
10+
<query>| rest /services/apps/local search="disabled=0" count=0 f=title splunk_server=local
11+
| rename title as app
12+
| table app</query>
13+
<earliest>-24h@h</earliest>
14+
<latest>now</latest>
15+
</search>
16+
</input>
17+
<input type="dropdown" token="type">
18+
<label>Knowledge Object Type (based on app)</label>
19+
<choice value="*">all</choice>
20+
<choice value="datamodel">datamodel</choice>
21+
<choice value="calcfields">calcfields</choice>
22+
<choice value="macros">macros</choice>
23+
<fieldForLabel>type</fieldForLabel>
24+
<fieldForValue>type</fieldForValue>
25+
<search>
26+
<query>| rest "/servicesNS/-/$app$/directory" count=0 splunk_server=local
27+
| search eai:acl.app=$app$
28+
| rename eai:type AS type
29+
| search type!="macros" `comment("macros only appears in really new versions of Splunk via the directory endpoint, so assume it doesn't exist in this query")`
30+
| stats count by type
31+
| fields - count</query>
32+
<earliest>-24h@h</earliest>
33+
<latest>now</latest>
34+
</search>
35+
<default>all</default>
36+
<initialValue>*</initialValue>
37+
</input>
38+
</fieldset>
39+
<row>
40+
<panel>
41+
<title>Knowledge object summary</title>
42+
<table>
43+
<search>
44+
<query>| rest "/servicesNS/-/$app$/directory" count=0 splunk_server=local
45+
| search eai:acl.app=$app$
46+
| eval updatedEpoch=strptime(updated,"%Y-%m-%dT%H:%M:%S%:z")
47+
| rename eai:type AS type, eai:acl.app AS app, eai:location AS location
48+
| append [ rest splunk_server=local /servicesNS/-/$app$/datamodel/model count=0 f=updated f=eai:appName | rename eai:appName AS app | eval type="datamodel" ]
49+
| append [ | rest splunk_server=local /servicesNS/-/$app$/data/props/calcfields count=0 | eval type="calcfields" | rename eai:acl.app AS app]
50+
| append [ | rest splunk_server=local /servicesNS/-/$app$/configs/conf-macros count=0 | rename eai:appName AS app | eval type="macros"]
51+
| fillnull location value="N/A"
52+
| search app=$app$
53+
| stats count by type, app, location</query>
54+
<earliest>-4h@m</earliest>
55+
<latest>now</latest>
56+
<sampleRatio>1</sampleRatio>
57+
</search>
58+
<option name="count">100</option>
59+
<option name="dataOverlayMode">none</option>
60+
<option name="drilldown">none</option>
61+
<option name="percentagesRow">false</option>
62+
<option name="refresh.display">progressbar</option>
63+
<option name="rowNumbers">false</option>
64+
<option name="totalsRow">false</option>
65+
<option name="wrap">false</option>
66+
</table>
67+
</panel>
68+
</row>
69+
<row>
70+
<panel>
71+
<title>Knowledge Objects by app semi-detailed</title>
72+
<table>
73+
<title>Click any row for the drilldown...</title>
74+
<search>
75+
<query>| rest "/servicesNS/-/$app$/directory" count=0 splunk_server=local
76+
| search eai:acl.app=$app$
77+
| eval updatedEpoch=strptime(updated,"%Y-%m-%dT%H:%M:%S%:z")
78+
| rename eai:type AS type, eai:acl.app AS app, eai:location AS location
79+
| append [ rest splunk_server=local /servicesNS/-/$app$/datamodel/model count=0 f=updated f=eai:appName | rename eai:appName AS app | eval type="datamodel" ]
80+
| append [ | rest splunk_server=local /servicesNS/-/$app$/data/props/calcfields count=0 | eval type="calcfields" | rename eai:acl.app AS app]
81+
| append [ | rest splunk_server=local /servicesNS/-/$app$/configs/conf-macros count=0 | rename eai:appName AS app | eval type="macros"]
82+
| fillnull location value="N/A"
83+
| search app=$app$, type=$type$
84+
| stats values(title) AS names, values(updated) AS updated by eai:acl.owner, eai:acl.sharing, type
85+
| rename eai:acl.sharing AS sharing, eai:acl.owner AS owner</query>
86+
<earliest>-4h@m</earliest>
87+
<latest>now</latest>
88+
<sampleRatio>1</sampleRatio>
89+
</search>
90+
<option name="count">100</option>
91+
<option name="dataOverlayMode">none</option>
92+
<option name="drilldown">cell</option>
93+
<option name="percentagesRow">false</option>
94+
<option name="rowNumbers">false</option>
95+
<option name="totalsRow">false</option>
96+
<option name="wrap">false</option>
97+
<drilldown>
98+
<link target="_blank">/app/monitoring/knowledge_objects_by_app_drilldown?form.app=$app$&amp;form.type=$row.type$&amp;form.sharing=$row.sharing$&amp;form.owner=$row.owner$</link>
99+
</drilldown>
100+
</table>
101+
</panel>
102+
</row>
103+
</form>
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
<form>
2+
<label>Knowledge Objects By App Drilldown</label>
3+
<description>List of knowledge objects per app by user/sharing level</description>
4+
<fieldset submitButton="false">
5+
<input type="dropdown" token="app">
6+
<label>Application Name</label>
7+
<fieldForLabel>app</fieldForLabel>
8+
<fieldForValue>app</fieldForValue>
9+
<search>
10+
<query>| rest /services/apps/local search="disabled=0" count=0 f=title splunk_server=local
11+
| rename title as app
12+
| table app</query>
13+
<earliest>-24h@h</earliest>
14+
<latest>now</latest>
15+
</search>
16+
</input>
17+
<input type="dropdown" token="type">
18+
<label>Knowledge Object Type (based on app)</label>
19+
<choice value="*">all</choice>
20+
<choice value="datamodel">datamodel</choice>
21+
<choice value="calcfields">calcfields</choice>
22+
<choice value="macros">macros</choice>
23+
<fieldForLabel>type</fieldForLabel>
24+
<fieldForValue>type</fieldForValue>
25+
<search>
26+
<query>| rest "/servicesNS/-/$app$/directory" count=0 splunk_server=local
27+
| search eai:acl.app=$app$
28+
| rename eai:type AS type
29+
| stats count by type
30+
| fields - count</query>
31+
<earliest>-24h@h</earliest>
32+
<latest>now</latest>
33+
</search>
34+
<default>all</default>
35+
<initialValue>*</initialValue>
36+
</input>
37+
<input type="text" token="owner">
38+
<label>User/Owner</label>
39+
<default>*</default>
40+
</input>
41+
<input type="dropdown" token="sharing">
42+
<label>Sharing Level</label>
43+
<choice value="*">All</choice>
44+
<choice value="app">app</choice>
45+
<choice value="user">user (private)</choice>
46+
<choice value="global">global</choice>
47+
<default>*</default>
48+
<initialValue>*</initialValue>
49+
</input>
50+
<input type="text" token="name">
51+
<label>Knowledge Object Name</label>
52+
<default>*</default>
53+
</input>
54+
<input type="radio" token="disabled">
55+
<label>Exclude disabled?</label>
56+
<choice value="0">Yes</choice>
57+
<choice value="*">No</choice>
58+
<default>*</default>
59+
</input>
60+
</fieldset>
61+
<row>
62+
<panel>
63+
<title>User Information</title>
64+
<table>
65+
<search>
66+
<query>| ldapsearch search="(&amp;(CN=$owner$)(objectClass=organizationalPerson))" attrs="mail,givenName,sn,displayName,description,manager"
67+
| eval name=if(isnotnull(givenName), givenName . " " . sn, displayName . " _ " . description), username="$owner$"
68+
| rex field=manager "CN=(?P&lt;managerid&gt;[^,]+)"
69+
| ldapfilter search="(&amp;(CN=$$managerid$$)(objectClass=organizationalPerson))" attrs="givenName,sn"
70+
| eval managerName = givenName . " " . sn
71+
| table name, mail, username, managerName</query>
72+
<earliest>-15m</earliest>
73+
<latest>now</latest>
74+
</search>
75+
<option name="count">10</option>
76+
<option name="drilldown">none</option>
77+
<option name="refresh.display">progressbar</option>
78+
</table>
79+
</panel>
80+
</row>
81+
<row>
82+
<panel>
83+
<title>Knowledge object summary</title>
84+
<table>
85+
<search>
86+
<query>| rest "/servicesNS/-/$app$/directory" count=0 splunk_server=local
87+
| search eai:acl.app=$app$
88+
| eval updatedEpoch=strptime(updated,"%Y-%m-%dT%H:%M:%S%:z")
89+
| rename eai:type AS type, eai:acl.app AS app, eai:location AS location
90+
| append [ rest splunk_server=local /servicesNS/-/$app$/datamodel/model count=0 f=updated f=eai:appName | rename eai:appName AS app | eval type="datamodel" ]
91+
| append [ | rest splunk_server=local /servicesNS/-/$app$/data/props/calcfields count=0 | eval type="calcfields" | rename eai:acl.app AS app]
92+
| append [ | rest splunk_server=local /servicesNS/-/$app$/configs/conf-macros count=0 | rename eai:appName AS app | eval type="macros"]
93+
| fillnull disabled
94+
| search app=$app$ type=$type$ title=$name$ eai:acl.sharing=$sharing$ disabled=$disabled$ eai:acl.owner=$owner$
95+
| fillnull location value="N/A"
96+
| rename title AS name, eai:acl.owner AS owner, eai:acl.sharing AS sharing
97+
| eval disabled=case(disabled==0,"false",disabled==1,"true",1==1,"Unknown")
98+
| table name, description, disabled, owner, sharing, type, updated</query>
99+
<earliest>-4h@m</earliest>
100+
<latest>now</latest>
101+
<sampleRatio>1</sampleRatio>
102+
</search>
103+
<option name="count">100</option>
104+
<option name="dataOverlayMode">none</option>
105+
<option name="drilldown">none</option>
106+
<option name="percentagesRow">false</option>
107+
<option name="refresh.display">progressbar</option>
108+
<option name="rowNumbers">false</option>
109+
<option name="totalsRow">false</option>
110+
<option name="wrap">false</option>
111+
</table>
112+
</panel>
113+
</row>
114+
</form>

0 commit comments

Comments
 (0)