How can i run some script (python or powershell) if i receive some particular log ??
either in search or in alert ??
search for the condition, save as an alert, add run a script as an alert action ...
read here:
https://docs.splunk.com/Documentation/SplunkCloud/8.0.0/Alert/Setupalertactions
navigate through the manual to find what you need