Skip to content

Commit 4e6516a

Browse files
authored
Changing to use the search function to reduce global objects that are not in the app context
1 parent 8712b16 commit 4e6516a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ As of October 2022, there are still no signs of version control within the Splun
329329
### 1.2.18
330330
Updates to `splunkversioncontrol_backup_class.py`:
331331
- Remove the "color" flag from the navigation menu if it exists during the backup
332+
- Add in a search argument for the application context for a minor performance improvement
332333

333334
### 1.2.18
334335
Updates to `splunkversioncontrol_backup_class.py`:

bin/splunkversioncontrol_backup_class.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def runQueries(self, app, endpoint, obj_type, fieldIgnoreList, aliasAttributes={
193193
creationSuccess = []
194194
#Keep a success list to be returned by this function
195195
#Use count=-1 to ensure we see all the objects
196-
url = self.splunk_rest + "/servicesNS/-/" + app + endpoint + "?count=-1" + extra_args
196+
url = f"{self.splunk_rest}/servicesNS/-/{app}{endpoint}?count=-1&search=eai:acl.app={app}{extra_args}"
197197
logger.debug("i=\"%s\" Running requests.get() on %s user=%s in app=%s, proxies_length=%s, sslVerify=%s" % (self.stanzaName, url, self.srcUsername, app, len(self.proxies), self.sslVerify))
198198

199199
headers = {}
@@ -800,7 +800,7 @@ def macros(self, app):
800800

801801
#servicesNS/-/-/properties/macros doesn't show private macros so using /configs/conf-macros to find all the macros
802802
#again with count=-1 to find all the available macros
803-
url = self.splunk_rest + "/servicesNS/-/" + app + "/configs/conf-macros?count=-1"
803+
url = f"{self.splunk_rest}/servicesNS/-/{app}/configs/conf-macros?count=-1&search=eai:acl.app={app}"
804804
logger.debug("i=\"%s\" Running requests.get() on url=%s with user=%s in app=%s for type macro proxies_length=%s, sslVerify=%s" % (self.stanzaName, url, self.srcUsername, app, len(self.proxies), self.sslVerify))
805805

806806
headers = {}
@@ -1984,5 +1984,4 @@ def run_script(self):
19841984
logger.warn("i=\"%s\" wiping the git directory, dir=%s to allow re-cloning on next run of the script" % (self.stanzaName, self.gitTempDir))
19851985
shutil.rmtree(self.gitTempDir)
19861986

1987-
logger.info("i=\"%s\" Done" % (self.stanzaName))
1988-
1987+
logger.info("i=\"%s\" Done" % (self.stanzaName))

0 commit comments

Comments
 (0)