From 4ac1d26fb53c740a052687be7700da1e53b080a5 Mon Sep 17 00:00:00 2001 From: Alfred Aquino Date: Thu, 22 May 2025 13:19:25 -0400 Subject: [PATCH] client.py-invalid-esc-seq trying to address the invalid escape sequence error --- splunklib/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/splunklib/client.py b/splunklib/client.py index ee390c9e..e102315a 100644 --- a/splunklib/client.py +++ b/splunklib/client.py @@ -779,7 +779,7 @@ def get_api_version(self, path): # For example, "/services/search/jobs" is using API v1 api_version = 1 - versionSearch = re.search('(?:servicesNS\/[^/]+\/[^/]+|services)\/[^/]+\/v(\d+)\/', path) + versionSearch = re.search('(?:services(?:NS)?)\/{1,2}\w+\/{1,2}v(\d)\/{1,2}', path) if versionSearch: api_version = int(versionSearch.group(1)) @@ -3999,4 +3999,4 @@ def batch_save(self, *documents): data = json.dumps(documents) return json.loads( - self._post('batch_save', headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8')) \ No newline at end of file + self._post('batch_save', headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8'))