Skip to content

Commit

Permalink
added upgrade steps
Browse files Browse the repository at this point in the history
  • Loading branch information
hardikhdholariya committed Jun 21, 2024
1 parent 392a4fc commit 63a52fa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cyences_app_for_splunk/bin/upgrade_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ def upgrade_4_8_0(session_key, logger):
time.sleep(60)


def upgrade_4_9_0(session_key, logger):
service = client.connect(token=session_key, app=cs_utils.APP_NAME)

SPLUNK_DEVICES_CLEANUP_SEARCH = '| makeresults count=1 | eval time=now() | map search="| cyencesdevicemanager operation="cleanup" products_to_cleanup="Splunk Internal" minindextime=$time$"'
logger.info("Cleaning up the Splunk devices from the device inventory due to field names changes")
response = service.jobs.oneshot(SPLUNK_DEVICES_CLEANUP_SEARCH, output_mode="json", earliest_time='now', latest_time='+1m')
handle_results(response, logger)

# Note:
# When the new alerts are introduced, we need to manually check whether the product is enabled for that alert.
# If product is enabled then, we need to manually enable the alert in the upgrade steps.
Expand All @@ -104,4 +112,5 @@ def upgrade_4_8_0(session_key, logger):
('4.4.0', None),
('4.5.0', upgrade_4_5_0),
('4.8.0', upgrade_4_8_0),
('4.9.0', upgrade_4_9_0),
)

0 comments on commit 63a52fa

Please sign in to comment.