<?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: Programming business rules inside Splunk in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Programming-business-rules-inside-Splunk/m-p/67787#M1564</link>
    <description>&lt;P&gt;Splunk is pretty flexible. Take a look at &lt;B&gt;lookup tables&lt;/B&gt; and &lt;B&gt;custom search commands&lt;/B&gt;.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/4.2/Knowledge/Addfieldsfromexternaldatasources" rel="nofollow"&gt;Lookup tables&lt;/A&gt; allow you to add new fields based on existing ones. Typically you'll use a CSV file, but you can also us custom Python code. Take a look at the earlier question about &lt;A href="http://answers.splunk.com/questions/5916/using-cidr-in-a-lookup-table" rel="nofollow"&gt;Using CIDR in a lookup table&lt;/A&gt; for more ideas.&lt;/P&gt;

&lt;P&gt;Custom search commands allow you to take things further, and process search results almost any way you want. Again, these would be written in Python. For more information, look &lt;A href="http://www.splunk.com/base/Documentation/4.2/SearchReference/Aboutcustomsearchcommands" rel="nofollow"&gt;here&lt;/A&gt; and &lt;A href="http://www.splunk.com/base/Documentation/4.2/Developer/SearchScripts" rel="nofollow"&gt;here&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;For your example case, a lookup is the way to go. If you are blacklisting individual IP addresses, create a CSV-based lookup with two fields &lt;CODE&gt;src_ip&lt;/CODE&gt; and &lt;CODE&gt;blacklisted&lt;/CODE&gt;, then search for, e.g., &lt;CODE&gt;blacklisted=1&lt;/CODE&gt;.  If you want to use network ranges instead, try the subnet lookup script referenced &lt;A href="http://answers.splunk.com/questions/5916/using-cidr-in-a-lookup-table" rel="nofollow"&gt;here&lt;/A&gt; or use &lt;A href="http://www.splunk.com/base/Documentation/4.2/Knowledge/Abouteventtypes" rel="nofollow"&gt;eventtypes&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Mar 2011 20:33:53 GMT</pubDate>
    <dc:creator>southeringtonp</dc:creator>
    <dc:date>2011-03-25T20:33:53Z</dc:date>
    <item>
      <title>Programming business rules inside Splunk</title>
      <link>https://community.splunk.com/t5/Reporting/Programming-business-rules-inside-Splunk/m-p/67783#M1560</link>
      <description>&lt;P&gt;Is it possible to program some special consolidation inside Splunk?&lt;/P&gt;

&lt;P&gt;For example: I want to run trough all log lines, ordered by id_user and date. For each 30 minutes a user navigate on my site, I count one visitor session, except for IPs inside a black list.&lt;/P&gt;

&lt;P&gt;Is Splunk made for it?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2011 19:16:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Programming-business-rules-inside-Splunk/m-p/67783#M1560</guid>
      <dc:creator>fduprat</dc:creator>
      <dc:date>2011-03-25T19:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Programming business rules inside Splunk</title>
      <link>https://community.splunk.com/t5/Reporting/Programming-business-rules-inside-Splunk/m-p/67784#M1561</link>
      <description>&lt;P&gt;Splunk can do just about anything provided you know how to write the search query.  Take a look at the 'transaction' command - I believe it is what you seek - &lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Transaction" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Transaction&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2011 19:28:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Programming-business-rules-inside-Splunk/m-p/67784#M1561</guid>
      <dc:creator>netwrkr</dc:creator>
      <dc:date>2011-03-25T19:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Programming business rules inside Splunk</title>
      <link>https://community.splunk.com/t5/Reporting/Programming-business-rules-inside-Splunk/m-p/67785#M1562</link>
      <description>&lt;P&gt;Thank you! I will take a look.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2011 19:45:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Programming-business-rules-inside-Splunk/m-p/67785#M1562</guid>
      <dc:creator>fduprat</dc:creator>
      <dc:date>2011-03-25T19:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Programming business rules inside Splunk</title>
      <link>https://community.splunk.com/t5/Reporting/Programming-business-rules-inside-Splunk/m-p/67786#M1563</link>
      <description>&lt;P&gt;This works fine, but I must always use that query-like structure inside Splunk?&lt;/P&gt;

&lt;P&gt;Can I do some kink of structured programming inside Splunk? &lt;/P&gt;

&lt;P&gt;Can I use Java inside Splunk?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2011 20:05:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Programming-business-rules-inside-Splunk/m-p/67786#M1563</guid>
      <dc:creator>fduprat</dc:creator>
      <dc:date>2011-03-25T20:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Programming business rules inside Splunk</title>
      <link>https://community.splunk.com/t5/Reporting/Programming-business-rules-inside-Splunk/m-p/67787#M1564</link>
      <description>&lt;P&gt;Splunk is pretty flexible. Take a look at &lt;B&gt;lookup tables&lt;/B&gt; and &lt;B&gt;custom search commands&lt;/B&gt;.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/4.2/Knowledge/Addfieldsfromexternaldatasources" rel="nofollow"&gt;Lookup tables&lt;/A&gt; allow you to add new fields based on existing ones. Typically you'll use a CSV file, but you can also us custom Python code. Take a look at the earlier question about &lt;A href="http://answers.splunk.com/questions/5916/using-cidr-in-a-lookup-table" rel="nofollow"&gt;Using CIDR in a lookup table&lt;/A&gt; for more ideas.&lt;/P&gt;

&lt;P&gt;Custom search commands allow you to take things further, and process search results almost any way you want. Again, these would be written in Python. For more information, look &lt;A href="http://www.splunk.com/base/Documentation/4.2/SearchReference/Aboutcustomsearchcommands" rel="nofollow"&gt;here&lt;/A&gt; and &lt;A href="http://www.splunk.com/base/Documentation/4.2/Developer/SearchScripts" rel="nofollow"&gt;here&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;For your example case, a lookup is the way to go. If you are blacklisting individual IP addresses, create a CSV-based lookup with two fields &lt;CODE&gt;src_ip&lt;/CODE&gt; and &lt;CODE&gt;blacklisted&lt;/CODE&gt;, then search for, e.g., &lt;CODE&gt;blacklisted=1&lt;/CODE&gt;.  If you want to use network ranges instead, try the subnet lookup script referenced &lt;A href="http://answers.splunk.com/questions/5916/using-cidr-in-a-lookup-table" rel="nofollow"&gt;here&lt;/A&gt; or use &lt;A href="http://www.splunk.com/base/Documentation/4.2/Knowledge/Abouteventtypes" rel="nofollow"&gt;eventtypes&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2011 20:33:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Programming-business-rules-inside-Splunk/m-p/67787#M1564</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2011-03-25T20:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Programming business rules inside Splunk</title>
      <link>https://community.splunk.com/t5/Reporting/Programming-business-rules-inside-Splunk/m-p/67788#M1565</link>
      <description>&lt;P&gt;have a try with: summary indexing and search macros&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2011 23:38:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Programming-business-rules-inside-Splunk/m-p/67788#M1565</guid>
      <dc:creator>fox</dc:creator>
      <dc:date>2011-03-25T23:38:07Z</dc:date>
    </item>
  </channel>
</rss>

