<?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 Need help creating an external lookup with Python. in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Need-help-creating-an-external-lookup-with-Python/m-p/522824#M9354</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P data-unlink="true"&gt;I've read through the documentation on external lookup with python and read through a few posts, could use some guidance.&amp;nbsp; What I am trying to do is use this &lt;A href="https://raw.githubusercontent.com/corelight/pycommunityid/master/scripts/community-id" target="_self"&gt;python script&lt;/A&gt;.&amp;nbsp; Giving the script arguments &lt;EM&gt;protocol src_ip dest_ip src_port dest_port&lt;/EM&gt;, gives you a calculated hash. Running it on its own works fine.&amp;nbsp; This is what I've done so far:&lt;BR /&gt;&lt;BR /&gt;Python script added to:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$SPLUNK_HOME/etc/apps/search/bin&lt;/LI-CODE&gt;
&lt;P data-unlink="true"&gt;Added stanza to transforms.conf:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[cid]
external_cmd = community-id.py Protocol SourceIp DestinationIp SourcePort DestinationPort
external_type = python
fields_list = Protocol, SourceIp, DestinationIp, SourcePort, DestinationPort&lt;/LI-CODE&gt;
&lt;P data-unlink="true"&gt;I've tried several examples of search commands that was in the documentation and what others have used, but haven't returned any results (errors).&amp;nbsp; So im not really sure if I'm doing this correctly.&amp;nbsp; I've noticed that some examples have their python scripts output to a .csv?&amp;nbsp; is that necessary?&amp;nbsp; should I approach this another way?&lt;/P&gt;
&lt;P data-unlink="true"&gt;BLUF:&amp;nbsp; I want to pass some fields into a python script to give me a calculated hash in a new field.&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Oct 2020 20:43:13 GMT</pubDate>
    <dc:creator>andrewj84</dc:creator>
    <dc:date>2020-10-06T20:43:13Z</dc:date>
    <item>
      <title>Need help creating an external lookup with Python.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Need-help-creating-an-external-lookup-with-Python/m-p/522824#M9354</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P data-unlink="true"&gt;I've read through the documentation on external lookup with python and read through a few posts, could use some guidance.&amp;nbsp; What I am trying to do is use this &lt;A href="https://raw.githubusercontent.com/corelight/pycommunityid/master/scripts/community-id" target="_self"&gt;python script&lt;/A&gt;.&amp;nbsp; Giving the script arguments &lt;EM&gt;protocol src_ip dest_ip src_port dest_port&lt;/EM&gt;, gives you a calculated hash. Running it on its own works fine.&amp;nbsp; This is what I've done so far:&lt;BR /&gt;&lt;BR /&gt;Python script added to:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$SPLUNK_HOME/etc/apps/search/bin&lt;/LI-CODE&gt;
&lt;P data-unlink="true"&gt;Added stanza to transforms.conf:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[cid]
external_cmd = community-id.py Protocol SourceIp DestinationIp SourcePort DestinationPort
external_type = python
fields_list = Protocol, SourceIp, DestinationIp, SourcePort, DestinationPort&lt;/LI-CODE&gt;
&lt;P data-unlink="true"&gt;I've tried several examples of search commands that was in the documentation and what others have used, but haven't returned any results (errors).&amp;nbsp; So im not really sure if I'm doing this correctly.&amp;nbsp; I've noticed that some examples have their python scripts output to a .csv?&amp;nbsp; is that necessary?&amp;nbsp; should I approach this another way?&lt;/P&gt;
&lt;P data-unlink="true"&gt;BLUF:&amp;nbsp; I want to pass some fields into a python script to give me a calculated hash in a new field.&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 20:43:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Need-help-creating-an-external-lookup-with-Python/m-p/522824#M9354</guid>
      <dc:creator>andrewj84</dc:creator>
      <dc:date>2020-10-06T20:43:13Z</dc:date>
    </item>
  </channel>
</rss>

