- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
06-14-2023 01:26 AM
Hi all,
In a list field, I want to go through all indexes one by one and if there is *malware* in all indexes(malware execution, malware alert, malware), I want to drop it. However, I could not edit this in the "Conditions for Incoming Incident" field.
For example, how can I do it, considering that we have "tag" field?
"tag Contains malware" like that.
tag data is ['malware execution','malware alert', 'malware'].
06-14-2023 04:27 AM - edited 06-14-2023 04:29 AM
Hi @YilmazDincer ,
Is that field not mapped and available in incident fields? If so, you can use filters. If you cannot use an incident field, you can achieve this by using a pre-processing script as below. If the script returns False, the incident will be dropped. This script assumes that the list is saved as a string. If it is already a list, you can eliminate the split part. The field name for the tags is assumed tags. Feel free to edit the script according to your environment.
try:
tags = demisto.incidents()[0]["CustomFields"]["tags"].split(",")
for tag in tags:
count = 0
if "malware" in tag:
count+=1
if count > 0:
demisto.results(False)
else:
demise.results(True)
except:
demise.results(True)
I hope my answer helps.
06-14-2023 04:27 AM - edited 06-14-2023 04:29 AM
Hi @YilmazDincer ,
Is that field not mapped and available in incident fields? If so, you can use filters. If you cannot use an incident field, you can achieve this by using a pre-processing script as below. If the script returns False, the incident will be dropped. This script assumes that the list is saved as a string. If it is already a list, you can eliminate the split part. The field name for the tags is assumed tags. Feel free to edit the script according to your environment.
try:
tags = demisto.incidents()[0]["CustomFields"]["tags"].split(",")
for tag in tags:
count = 0
if "malware" in tag:
count+=1
if count > 0:
demisto.results(False)
else:
demise.results(True)
except:
demise.results(True)
I hope my answer helps.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!