<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Getting error foe External lookup, Script execution failed for external search command in Installation</title>
    <link>https://community.splunk.com/t5/Installation/Getting-error-foe-External-lookup-Script-execution-failed-for/m-p/516395#M6607</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;BR /&gt;I am working on External lookup, below is my code&lt;BR /&gt;&lt;BR /&gt;new.py&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import csv
import os,sys
import subprocess
import requests
import sys
import json

infile = sys.stdin
outfile = sys.stdout
r = csv.DictReader(infile)
result = 0
new_fieldnames = ["clientip", "fraud_score", "country_code", "success"] 
w = csv.DictWriter(outfile, fieldnames=new_fieldnames)
w.writeheader()

apiURL = "my-api"
clientip = sys.argv[1]
URL = apiURL + clientip
r = requests.get(URL)
data = r.json()
result = {"clientip":str(data["host"]),"fraud_score": str(data["fraud_score"]), "country_code":str(data["country_code"]), "success":str(data["success"])}
w.writerow(result)&lt;/LI-CODE&gt;&lt;P&gt;Above code is giving output as below:-&lt;BR /&gt;&lt;BR /&gt;/opt/splunk/bin/splunk cmd python /opt/splunk/etc/apps/TA-test/bin/new.py 172.168.0.2&lt;BR /&gt;clientip,fraud_score,country_code,success&lt;BR /&gt;172.168.0.2,75,US,True&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Aug 2020 21:27:06 GMT</pubDate>
    <dc:creator>abhishekkalokhe</dc:creator>
    <dc:date>2020-08-26T21:27:06Z</dc:date>
    <item>
      <title>Getting error foe External lookup, Script execution failed for external search command</title>
      <link>https://community.splunk.com/t5/Installation/Getting-error-foe-External-lookup-Script-execution-failed-for/m-p/516395#M6607</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;BR /&gt;I am working on External lookup, below is my code&lt;BR /&gt;&lt;BR /&gt;new.py&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import csv
import os,sys
import subprocess
import requests
import sys
import json

infile = sys.stdin
outfile = sys.stdout
r = csv.DictReader(infile)
result = 0
new_fieldnames = ["clientip", "fraud_score", "country_code", "success"] 
w = csv.DictWriter(outfile, fieldnames=new_fieldnames)
w.writeheader()

apiURL = "my-api"
clientip = sys.argv[1]
URL = apiURL + clientip
r = requests.get(URL)
data = r.json()
result = {"clientip":str(data["host"]),"fraud_score": str(data["fraud_score"]), "country_code":str(data["country_code"]), "success":str(data["success"])}
w.writerow(result)&lt;/LI-CODE&gt;&lt;P&gt;Above code is giving output as below:-&lt;BR /&gt;&lt;BR /&gt;/opt/splunk/bin/splunk cmd python /opt/splunk/etc/apps/TA-test/bin/new.py 172.168.0.2&lt;BR /&gt;clientip,fraud_score,country_code,success&lt;BR /&gt;172.168.0.2,75,US,True&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 21:27:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Getting-error-foe-External-lookup-Script-execution-failed-for/m-p/516395#M6607</guid>
      <dc:creator>abhishekkalokhe</dc:creator>
      <dc:date>2020-08-26T21:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error foe External lookup, Script execution failed for external search command</title>
      <link>https://community.splunk.com/t5/Installation/Getting-error-foe-External-lookup-Script-execution-failed-for/m-p/516397#M6608</link>
      <description>&lt;P&gt;I am using below transforms.conf&lt;BR /&gt;&lt;BR /&gt;[new]&lt;BR /&gt;allow_caching = 0&lt;BR /&gt;case_sensitive_match = 1&lt;BR /&gt;external_cmd = new.py clientip&lt;BR /&gt;fields_list = clientip,fraud_score,country_code,success&lt;BR /&gt;&lt;BR /&gt;And getting this error -&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;Script execution failed for external search command '/opt/splunk/etc/apps/TA-test/bin/new.py'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 21:29:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Getting-error-foe-External-lookup-Script-execution-failed-for/m-p/516397#M6608</guid>
      <dc:creator>abhishekkalokhe</dc:creator>
      <dc:date>2020-08-26T21:29:41Z</dc:date>
    </item>
  </channel>
</rss>

