<?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 Re: How to configure Splunk with my python script for an external lookup? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-Splunk-with-my-python-script-for-an-external/m-p/427848#M122469</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;fields_list = &amp;lt;string&amp;gt;: is a list of all fields that are supported by the external lookup. The fields must be delimited by a comma followed by a space.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above was in the link you shared.  Please read the link again very carefully and I think you’ll resolve your problem.&lt;/P&gt;

&lt;P&gt;Where will you “return csv”?   Should it return as events in the search pipeline?  Or are you making your external lookup code write a csv somewhere on the file system?&lt;/P&gt;</description>
    <pubDate>Mon, 04 Jun 2018 18:26:23 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2018-06-04T18:26:23Z</dc:date>
    <item>
      <title>How to configure Splunk with my python script for an external lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-Splunk-with-my-python-script-for-an-external/m-p/427847#M122468</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to build my own python code that gets parameter IP address, My script using IP2Location and return information about the IP address with IP2Location DB IP2Location&lt;BR /&gt;
&lt;A href="https://www.ip2location.com/developers"&gt;https://www.ip2location.com/developers&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So what I did is build my python script that receives IP address and returns CSV row with the result of IP2Location.&lt;BR /&gt;
My script is located in: &lt;BR /&gt;
&lt;CODE&gt;/opt/splunk/etc/apps/search/bin&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;And in transforms.conf I configured According this tutorial:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/7.0.3/Knowledge/Configureexternallookups"&gt;https://docs.splunk.com/Documentation/SplunkCloud/7.0.3/Knowledge/Configureexternallookups&lt;/A&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ip2location]
external_cmd = ip2location.py clientip 
fields_list = What shold I write here?
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm trying to understand:&lt;BR /&gt;
1. How do I need to configure the section on [ip2location] in transform.conf?&lt;BR /&gt;
2. What is the meaning of fields_list?&lt;BR /&gt;
3. How can I make my script to work in Splunk? I just want Splunk to give my script IP address and return csv as result.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 14:42:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-Splunk-with-my-python-script-for-an-external/m-p/427847#M122468</guid>
      <dc:creator>yko84108</dc:creator>
      <dc:date>2018-06-04T14:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure Splunk with my python script for an external lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-Splunk-with-my-python-script-for-an-external/m-p/427848#M122469</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;fields_list = &amp;lt;string&amp;gt;: is a list of all fields that are supported by the external lookup. The fields must be delimited by a comma followed by a space.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above was in the link you shared.  Please read the link again very carefully and I think you’ll resolve your problem.&lt;/P&gt;

&lt;P&gt;Where will you “return csv”?   Should it return as events in the search pipeline?  Or are you making your external lookup code write a csv somewhere on the file system?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 18:26:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-Splunk-with-my-python-script-for-an-external/m-p/427848#M122469</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2018-06-04T18:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure Splunk with my python script for an external lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-Splunk-with-my-python-script-for-an-external/m-p/427849#M122470</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
About 1 - I read that, but what that is mean about my csv? I need to write my csv fields?&lt;BR /&gt;
"return csv" - mean I'm using python the use csv.writer to write to sys.stdout not to file system&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 06:23:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-Splunk-with-my-python-script-for-an-external/m-p/427849#M122470</guid>
      <dc:creator>yko84108</dc:creator>
      <dc:date>2018-06-05T06:23:57Z</dc:date>
    </item>
  </channel>
</rss>

