Skip to content

Commit

Permalink
QRadar: better error message when search fails (#27039)
Browse files Browse the repository at this point in the history
* better error msg

* RN
  • Loading branch information
ilaner authored May 29, 2023
1 parent 67f2fdc commit c4a2c68
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Packs/QRadar/Integrations/QRadar_v3/QRadar_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -2564,8 +2564,11 @@ def qradar_search_create_command(client: Client, params: Dict, args: Dict) -> Co
if query_expression or saved_search_id:
try:
response = client.search_create(query_expression, saved_search_id)
except Exception:
raise DemistoException(f'Could not create search for offense_id: {offense_id}')
except Exception as e:
if query_expression:
raise DemistoException(f'Could not create search for query: {query_expression}.') from e
if saved_search_id:
raise DemistoException(f'Could not create search for saved_search_id: {saved_search_id}.') from e
else:
response = create_events_search(client,
fetch_mode,
Expand All @@ -2575,7 +2578,7 @@ def qradar_search_create_command(client: Client, params: Dict, args: Dict) -> Co
start_time,
return_raw_response=True)
if response == QueryStatus.ERROR.value:
raise DemistoException(f'Could not create events search for offense_id: {offense_id}')
raise DemistoException(f'Could not create events search for offense_id: {offense_id}.')

outputs = sanitize_outputs(response, SEARCH_OLD_NEW_MAP)
return CommandResults(
Expand Down
7 changes: 7 additions & 0 deletions Packs/QRadar/ReleaseNotes/2_4_20.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

#### Integrations

##### IBM QRadar v3

- Fixed the error message in **qradar-search-create** command where the `query_expression` or `saved_search_id` argument was provided.
- Updated the Docker image to: *demisto/python3:3.10.11.61265*.
2 changes: 1 addition & 1 deletion Packs/QRadar/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "IBM QRadar",
"description": "Fetch offenses as incidents and search QRadar",
"support": "xsoar",
"currentVersion": "2.4.19",
"currentVersion": "2.4.20",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down

0 comments on commit c4a2c68

Please sign in to comment.