Exception raised on Get App Logs during the get_deployments call:
2024-07-17 09:54:10,583 ERROR pid=1514895 tid=MainThread file=log.py:log_exception:351 | exc_l="app_logs_input_exception" Exception raised while ingesting data for app_logs_input:
Traceback (most recent call last):
File "/opt/splunk/etc/apps/TA-idelta-add-on-for-mulesoft-cloudhub2/bin/app_logs_input_helper.py", line 191, in stream_events
for deployment_name, deployment_id in get_deployments(access_token, org_id, env_id).items():
File "/opt/splunk/etc/apps/TA-idelta-add-on-for-mulesoft-cloudhub2/bin/app_logs_input_helper.py", line 55, in get_deployments
for app in response['items']:
KeyError: 'items'
understand why the issue is happening (no data?)
Exception I was receiving was due to an error on the environments ID. Triple click copy and paste from the discovery dashboard resulted in bad characters at the end of the org ID guid. This couldn't be seen on paste due to the field being asterisk'd out (password field) when setting up the environment.
better error handling and logging
Added one INFO and one DEBUG log statement in get_deployments() to help understand what is happening when things go wrong.
Two tasks here:
Exception raised on Get App Logs during the get_deployments call:
2024-07-17 09:54:10,583 ERROR pid=1514895 tid=MainThread file=log.py:log_exception:351 | exc_l="app_logs_input_exception" Exception raised while ingesting data for app_logs_input: Traceback (most recent call last): File "/opt/splunk/etc/apps/TA-idelta-add-on-for-mulesoft-cloudhub2/bin/app_logs_input_helper.py", line 191, in stream_events for deployment_name, deployment_id in get_deployments(access_token, org_id, env_id).items(): File "/opt/splunk/etc/apps/TA-idelta-add-on-for-mulesoft-cloudhub2/bin/app_logs_input_helper.py", line 55, in get_deployments for app in response['items']: KeyError: 'items'