<?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: Is Python the only supported language, or can I create a custom command or macro via Ruby? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-Python-the-only-supported-language-or-can-I-create-a-custom/m-p/262207#M50326</link>
    <description>&lt;P&gt;IMHO, this is a simple enough script, I would go ahead and port it to python as a &lt;CODE&gt;scripted/external lookup&lt;/CODE&gt;.  It is well worth the exercise and once you have done it once, you can add that to your Splunk toolbox.&lt;/P&gt;</description>
    <pubDate>Tue, 24 May 2016 07:17:19 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2016-05-24T07:17:19Z</dc:date>
    <item>
      <title>Is Python the only supported language, or can I create a custom command or macro via Ruby?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-Python-the-only-supported-language-or-can-I-create-a-custom/m-p/262206#M50325</link>
      <description>&lt;P&gt;All, &lt;/P&gt;

&lt;P&gt;A vendor just sent me this script to decode their vendor message table. It's not just a simple lookup, but a concatenation with several events.  I see guides on Python. Is that the only supported language for custom commands? Should I just use Python to wrap this? Any guides on this? &lt;/P&gt;

&lt;P&gt;thanks!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/usr/bin/env ruby
# to use:
#   chmod 744 threat_extract.rb
#   ./threat_extract.rb $THREATS_NUMBER

arg = ARGV.first.to_i

hsh = {
     1 =&amp;gt; 'Known Violators',
     2 =&amp;gt; 'Blocked Country',
     4 =&amp;gt; 'Browser Integrity Check',
     8 =&amp;gt; 'Known Violator User Agent',
    16 =&amp;gt; 'Rate Limited',
    32 =&amp;gt; 'Known Violator Honeypot Access',
    64 =&amp;gt; 'Referrer Block',
   128 =&amp;gt; 'Session Length Exceeded',
   256 =&amp;gt; 'Pages Per Session Exceeded',
   512 =&amp;gt; 'Bad User Agents',
  1024 =&amp;gt; 'Aggregator User Agents',
  2048 =&amp;gt; 'Filtered IP',
  4096 =&amp;gt; 'JavaScript Not Loaded',
  8192 =&amp;gt; 'JavaScript Check Failed',
 16384 =&amp;gt; 'Identifier Validation Error',
 32768 =&amp;gt; 'Known Violator Automation Tool',
 65536 =&amp;gt; 'Form Spam Submission',
131072 =&amp;gt; 'Unverified Signature',
262144 =&amp;gt; 'IP Pinning Failure',
524288 =&amp;gt; 'Invalid JavaScript Test Results',
1048576 =&amp;gt; 'Organization Block',
2097152 =&amp;gt; 'Known Violator Data Center'
}

puts *hsh.reject { |(k, v)| (k &amp;amp; arg).zero? }.map {|(k, v)| "#{k} =&amp;gt; #{v}"}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 May 2016 04:15:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-Python-the-only-supported-language-or-can-I-create-a-custom/m-p/262206#M50325</guid>
      <dc:creator>daniel333</dc:creator>
      <dc:date>2016-05-24T04:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is Python the only supported language, or can I create a custom command or macro via Ruby?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-Python-the-only-supported-language-or-can-I-create-a-custom/m-p/262207#M50326</link>
      <description>&lt;P&gt;IMHO, this is a simple enough script, I would go ahead and port it to python as a &lt;CODE&gt;scripted/external lookup&lt;/CODE&gt;.  It is well worth the exercise and once you have done it once, you can add that to your Splunk toolbox.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2016 07:17:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-Python-the-only-supported-language-or-can-I-create-a-custom/m-p/262207#M50326</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-05-24T07:17:19Z</dc:date>
    </item>
  </channel>
</rss>

