blob: c8d1d13deb3ea5901da20bcaa9e40407bd7a1459 [file] [log] [blame]
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia at 2017-02-23
| Rendered using Apache Maven Fluido Skin 1.3.0
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="Date-Revision-yyyymmdd" content="20170223" />
<meta http-equiv="Content-Language" content="en" />
<title>Metron &#x2013; Stellar REPL Management Utilities</title>
<link rel="stylesheet" href="../../css/apache-maven-fluido-1.3.0.min.css" />
<link rel="stylesheet" href="../../css/site.css" />
<link rel="stylesheet" href="../../css/print.css" media="print" />
<script type="text/javascript" src="../../js/apache-maven-fluido-1.3.0.min.js"></script>
<script type="text/javascript">$( document ).ready( function() { $( '.carousel' ).carousel( { interval: 3500 } ) } );</script>
</head>
<body class="topBarDisabled">
<div class="container-fluid">
<div id="banner">
<div class="pull-left">
<a href="http://metron.incubator.apache.org/" id="bannerLeft">
<img src="../../images/metron-logo.png" alt="Apache Metron - Incubating" width="148px" height="48px"/>
</a>
</div>
<div class="pull-right"> <a href="http://incubator.apache.org/" id="bannerRight">
<img src="../../images/ApacheIncubating_Logo.png" alt="Apache Incubating" width="192px" height="48px"/>
</a>
</div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li class="">
<a href="http://www.apache.org" class="externalLink" title="Apache">
Apache</a>
</li>
<li class="divider ">/</li>
<li class="">
<a href="http://metron.incubator.apache.org/" class="externalLink" title="Metron-Incubating">
Metron-Incubating</a>
</li>
<li class="divider ">/</li>
<li class="">
<a href="../../index.html" title="Documentation">
Documentation</a>
</li>
<li class="divider ">/</li>
<li class="">Stellar REPL Management Utilities</li>
<li id="publishDate" class="pull-right">Last Published: 2017-02-23</li> <li class="divider pull-right">|</li>
<li id="projectVersion" class="pull-right">Version: 0.3.1</li>
</ul>
</div>
<div class="row-fluid">
<div id="leftColumn" class="span3">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">User Documentation</li>
<li>
<a href="../../index.html" title="Metron">
<i class="icon-chevron-down"></i>
Metron</a>
<ul class="nav nav-list">
<li>
<a href="../../Upgrading.html" title="Upgrading">
<i class="none"></i>
Upgrading</a>
</li>
<li>
<a href="../../metron-analytics/index.html" title="Analytics">
<i class="icon-chevron-right"></i>
Analytics</a>
</li>
<li>
<a href="../../metron-deployment/index.html" title="Deployment">
<i class="icon-chevron-right"></i>
Deployment</a>
</li>
<li>
<a href="../../metron-docker/index.html" title="Docker">
<i class="none"></i>
Docker</a>
</li>
<li>
<a href="../../metron-platform/index.html" title="Platform">
<i class="icon-chevron-down"></i>
Platform</a>
<ul class="nav nav-list">
<li>
<a href="../../metron-platform/metron-api/index.html" title="Api">
<i class="none"></i>
Api</a>
</li>
<li>
<a href="../../metron-platform/metron-common/index.html" title="Common">
<i class="none"></i>
Common</a>
</li>
<li>
<a href="../../metron-platform/metron-data-management/index.html" title="Data-management">
<i class="none"></i>
Data-management</a>
</li>
<li>
<a href="../../metron-platform/metron-enrichment/index.html" title="Enrichment">
<i class="none"></i>
Enrichment</a>
</li>
<li>
<a href="../../metron-platform/metron-indexing/index.html" title="Indexing">
<i class="none"></i>
Indexing</a>
</li>
<li class="active">
<a href="#"><i class="none"></i>Management</a>
</li>
<li>
<a href="../../metron-platform/metron-parsers/index.html" title="Parsers">
<i class="none"></i>
Parsers</a>
</li>
<li>
<a href="../../metron-platform/metron-pcap-backend/index.html" title="Pcap-backend">
<i class="none"></i>
Pcap-backend</a>
</li>
</ul>
</li>
<li>
<a href="../../metron-sensors/index.html" title="Sensors">
<i class="icon-chevron-right"></i>
Sensors</a>
</li>
</ul>
</li>
</ul>
<hr class="divider" />
<div id="poweredBy">
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="builtBy" alt="Built by Maven" src="../../images/logos/maven-feather.png" />
</a>
</div>
</div>
</div>
<div id="bodyColumn" class="span9" >
<h1>Stellar REPL Management Utilities</h1>
<p><a name="Stellar_REPL_Management_Utilities"></a></p>
<p>In order to augment the functionality of the Stellar REPL, a few management functions surrounding the management of the configurations and the management of Stellar transformations in the following areas have been added:</p>
<ul>
<li>Stellar field transformations in the Parsers</li>
<li>Stellar enrichments in the Enrichment topology</li>
<li>Stellar threat triage rules</li>
</ul>
<p>Additionally, some shell functions have been added to </p>
<ul>
<li>provide the ability to refer to the Stellar expression used to create a variable</li>
<li>print structured data in a way that is easier to view (i.e. tabular)</li>
</ul>
<p>This functionality is exposed as a pack of Stellar functions in this project.</p>
<div class="section">
<h2><a name="Function_Details"></a>Function Details</h2>
<p>The functions are split roughly into a few sections:</p>
<ul>
<li>Shell functions - Functions surrounding interacting with the shell in either a nicer way or a more functional way.</li>
<li>Grok Functions - Functions that allow you to evaluate grok expressions.</li>
<li>File functions - Functions around interacting with local or HDFS files</li>
<li>Configuration functions - Functions surrounding pulling and pushing configs from zookeeper</li>
<li>Parser functions - Functions surrounding adding, viewing, and removing Parser functions.</li>
<li>Enrichment functions - Functions surrounding adding, viewing and removing Stellar enrichments as well as managing batch size and index names for the enrichment topology configuration</li>
<li>Threat Triage functions - Functions surrounding adding, viewing and removing threat triage functions.</li>
</ul>
<div class="section">
<h3><a name="Grok_Functions"></a>Grok Functions</h3>
<ul>
<li><tt>GROK_EVAL</tt>
<ul>
<li>Description: Evaluate a grok expression for a statement.</li>
<li>Input:
<ul>
<li>grokExpression - The grok expression to evaluate</li>
<li>data - Either a data message or a list of data messages to evaluate using the grokExpression</li>
</ul></li>
<li>Returns: The Map associated with the grok expression being evaluated on the list of messages.</li>
</ul></li>
<li><tt>GROK_PREDICT</tt>
<ul>
<li>Description: Discover a grok statement for an input doc</li>
<li>Input:
<ul>
<li>data - The data to discover a grok expression from</li>
</ul></li>
<li>Returns: A grok expression that should match the data.</li>
</ul></li>
</ul></div>
<div class="section">
<h3><a name="File_Functions"></a>File Functions</h3>
<ul>
<li>Local Files
<ul>
<li><tt>LOCAL_LS</tt>
<ul>
<li>Description: Lists the contents of a directory.</li>
<li>Input:
<ul>
<li>path - The path of the file</li>
</ul></li>
<li>Returns: The contents of the directory in tabular form sorted by last modification date.</li>
</ul></li>
<li><tt>LOCAL_RM</tt>
<ul>
<li>Description: Removes the path</li>
<li>Input:
<ul>
<li>path - The path of the file or directory.</li>
<li>recursive - Recursively remove or not (optional and defaulted to false)</li>
</ul></li>
<li>Returns: boolean - true if successful, false otherwise</li>
</ul></li>
<li><tt>LOCAL_READ</tt>
<ul>
<li>Description: Retrieves the contents as a string of a file.</li>
<li>Input:
<ul>
<li>path - The path of the file</li>
</ul></li>
<li>Returns: The contents of the file and null otherwise.</li>
</ul></li>
<li><tt>LOCAL_READ_LINES</tt>
<ul>
<li>Description: Retrieves the contents of a file as a list of strings.</li>
<li>Input:
<ul>
<li>path - The path of the file</li>
</ul></li>
<li>Returns: A list of lines</li>
</ul></li>
<li><tt>LOCAL_WRITE</tt>
<ul>
<li>Description: Writes the contents of a string to a local file</li>
<li>Input:
<ul>
<li>content - The content to write out</li>
<li>path - The path of the file</li>
</ul></li>
<li>Returns: true if the file was written and false otherwise.</li>
</ul></li>
</ul></li>
<li>HDFS Files
<ul>
<li><tt>HDFS_LS</tt>
<ul>
<li>Description: Lists the contents of a directory in HDFS.</li>
<li>Input:
<ul>
<li>path - The path of the file</li>
</ul></li>
<li>Returns: The contents of the directory in tabular form sorted by last modification date.</li>
</ul></li>
<li><tt>HDFS_RM</tt>
<ul>
<li>Description: Removes the path in HDFS.</li>
<li>Input:
<ul>
<li>path - The path of the file or directory.</li>
<li>recursive - Recursively remove or not (optional and defaulted to false)</li>
</ul></li>
<li>Returns: boolean - true if successful, false otherwise</li>
</ul></li>
<li><tt>HDFS_READ</tt>
<ul>
<li>Description: Retrieves the contents as a string of a file in HDFS.</li>
<li>Input:
<ul>
<li>path - The path of the file</li>
</ul></li>
<li>Returns: The contents of the file and null otherwise.</li>
</ul></li>
<li><tt>HDFS_READ_LINES</tt>
<ul>
<li>Description: Retrieves the contents of a HDFS file as a list of strings.</li>
<li>Input:
<ul>
<li>path - The path of the file</li>
</ul></li>
<li>Returns: A list of lines</li>
</ul></li>
<li><tt>HDFS_WRITE</tt>
<ul>
<li>Description: Writes the contents of a string to a HDFS file</li>
<li>Input:
<ul>
<li>content - The content to write out</li>
<li>path - The path of the file</li>
</ul></li>
<li>Returns: true if the file was written and false otherwise.</li>
</ul></li>
</ul></li>
</ul></div>
<div class="section">
<h3><a name="Shell_Functions"></a>Shell Functions</h3>
<ul>
<li><tt>SHELL_EDIT</tt>
<ul>
<li>Description: Open an editor (optionally initialized with text) and return whatever is saved from the editor. The editor to use is pulled from <tt>EDITOR</tt> or <tt>VISUAL</tt> environment variable.</li>
<li>Input:
<ul>
<li>string - (Optional) A string whose content is used to initialize the editor.</li>
</ul></li>
<li>Returns: The content that the editor saved after editor exit.</li>
</ul></li>
<li><tt>SHELL_GET_EXPRESSION</tt>
<ul>
<li>Description: Get a stellar expression from a variable</li>
<li>Input:
<ul>
<li>variable - variable name</li>
</ul></li>
<li>Returns: The stellar expression associated with the variable.</li>
</ul></li>
<li><tt>SHELL_LIST_VARS</tt>
<ul>
<li>Description: Return the variables in a tabular form</li>
<li>Input:
<ul>
<li>wrap : Length of string to wrap the columns</li>
</ul></li>
<li>Returns: A tabular representation of the variables.</li>
</ul></li>
<li><tt>SHELL_MAP2TABLE</tt>
<ul>
<li>Description: Take a map and return a table</li>
<li>Input:
<ul>
<li>map - Map</li>
</ul></li>
<li>Returns: The map in table form</li>
</ul></li>
<li><tt>SHELL_VARS2MAP</tt>
<ul>
<li>Description: Take a set of variables and return a map</li>
<li>Input:
<ul>
<li>variables* - variable names to use to create map</li>
</ul></li>
<li>Returns: A map associating the variable name with the stellar expression.</li>
</ul></li>
</ul></div>
<div class="section">
<h3><a name="Configuration_Functions"></a>Configuration Functions</h3>
<ul>
<li><tt>CONFIG_GET</tt>
<ul>
<li>Description: Retrieve a Metron configuration from zookeeper.</li>
<li>Input:
<ul>
<li>type - One of ENRICHMENT, INDEXING, PARSER, GLOBAL, PROFILER</li>
<li>sensor - Sensor to retrieve (required for enrichment and parser, not used for profiler and global)</li>
<li>emptyIfNotPresent - If true, then return an empty, minimally viable config</li>
</ul></li>
<li>Returns: The String representation of the config in zookeeper</li>
</ul></li>
<li><tt>CONFIG_PUT</tt>
<ul>
<li>Description: Updates a Metron config to Zookeeper.</li>
<li>Input:
<ul>
<li>type - One of ENRICHMENT, INDEXING, PARSER, GLOBAL, PROFILER</li>
<li>config - The config (a string in JSON form) to update</li>
<li>sensor - Sensor to retrieve (required for enrichment and parser, not used for profiler and global)</li>
</ul></li>
<li>Returns: The String representation of the config in zookeeper</li>
</ul></li>
</ul></div>
<div class="section">
<h3><a name="Parser_Functions"></a>Parser Functions</h3>
<ul>
<li><tt>PARSER_STELLAR_TRANSFORM_ADD</tt>
<ul>
<li>Description: Add stellar field transformation.</li>
<li>Input:
<ul>
<li>sensorConfig - Sensor config to add transformation to.</li>
<li>stellarTransforms - A Map associating fields to stellar expressions</li>
</ul></li>
<li>Returns: The String representation of the config in zookeeper</li>
</ul></li>
<li><tt>PARSER_STELLAR_TRANSFORM_PRINT</tt>
<ul>
<li>Description: Retrieve stellar field transformations.</li>
<li>Input:
<ul>
<li>sensorConfig - Sensor config to add transformation to.</li>
</ul></li>
<li>Returns: The String representation of the transformations</li>
</ul></li>
<li><tt>PARSER_STELLAR_TRANSFORM_REMOVE</tt>
<ul>
<li>Description: Remove stellar field transformation.</li>
<li>Input:
<ul>
<li>sensorConfig - Sensor config to add transformation to.</li>
<li>stellarTransforms - A list of stellar transforms to remove</li>
</ul></li>
<li>Returns: The String representation of the config in zookeeper</li>
</ul></li>
</ul></div>
<div class="section">
<h3><a name="Indexing_Functions"></a>Indexing Functions</h3>
<ul>
<li><tt>INDEXING_SET_BATCH</tt>
<ul>
<li>Description: Set batch size</li>
<li>Input:
<ul>
<li>sensorConfig - Sensor config to add transformation to.</li>
<li>writer - The writer to update (e.g. elasticsearch, solr or hdfs)</li>
<li>size - batch size (integer)</li>
</ul></li>
<li>Returns: The String representation of the config in zookeeper</li>
</ul></li>
<li><tt>INDEXING_SET_ENABLED</tt>
<ul>
<li>Description: Enable or disable an indexing writer for a sensor.</li>
<li>Input:
<ul>
<li>sensorConfig - Sensor config to add transformation to.</li>
<li>writer - The writer to update (e.g. elasticsearch, solr or hdfs)</li>
<li>enabled? - boolean indicating whether the writer is enabled. If omitted, then it will set enabled.</li>
</ul></li>
<li>Returns: The String representation of the config in zookeeper</li>
</ul></li>
<li><tt>INDEXING_SET_INDEX</tt>
<ul>
<li>Description: Set the index for the sensor</li>
<li>Input:
<ul>
<li>sensorConfig - Sensor config to add transformation to.</li>
<li>writer - The writer to update (e.g. elasticsearch, solr or hdfs)</li>
<li>sensor - sensor name</li>
</ul></li>
<li>Returns: The String representation of the config in zookeeper</li>
</ul></li>
</ul></div>
<div class="section">
<h3><a name="Enrichment_Functions"></a>Enrichment Functions</h3>
<ul>
<li><tt>ENRICHMENT_STELLAR_TRANSFORM_ADD</tt>
<ul>
<li>Description: Add stellar field transformation.</li>
<li>Input:
<ul>
<li>sensorConfig - Sensor config to add transformation to.</li>
<li>type - ENRICHMENT or THREAT_INTEL</li>
<li>stellarTransforms - A Map associating fields to stellar expressions</li>
<li>group - Group to add to (optional)</li>
</ul></li>
<li>Returns: The String representation of the config in zookeeper</li>
</ul></li>
<li><tt>ENRICHMENT_STELLAR_TRANSFORM_PRINT</tt>
<ul>
<li>Description: Retrieve stellar enrichment transformations.</li>
<li>Input:
<ul>
<li>sensorConfig - Sensor config to add transformation to.</li>
<li>type - ENRICHMENT or THREAT_INTEL</li>
</ul></li>
<li>Returns: The String representation of the transformations</li>
</ul></li>
<li><tt>ENRICHMENT_STELLAR_TRANSFORM_REMOVE</tt>
<ul>
<li>Description: Remove one or more stellar field transformations.</li>
<li>Input:
<ul>
<li>sensorConfig - Sensor config to add transformation to.</li>
<li>type - ENRICHMENT or THREAT_INTEL</li>
<li>stellarTransforms - A list of removals</li>
<li>group - Group to remove from (optional)</li>
</ul></li>
<li>Returns: The String representation of the config in zookeeper</li>
</ul></li>
</ul></div>
<div class="section">
<h3><a name="Threat_Triage_Functions"></a>Threat Triage Functions</h3>
<ul>
<li><tt>THREAT_TRIAGE_ADD</tt>
<ul>
<li>Description: Add a threat triage rule.</li>
<li>Input:
<ul>
<li>sensorConfig - Sensor config to add transformation to.</li>
<li>stellarTransforms - A Map associating stellar rules to scores</li>
<li>triageRules - Map (or list of Maps) representing a triage rule. It must contain &#x2018;rule&#x2019; and &#x2018;score&#x2019; keys, the stellar expression for the rule and triage score respectively. It may contain &#x2018;name&#x2019; and &#x2018;comment&#x2019;, the name of the rule and comment associated with the rule respectively.&quot;</li>
</ul></li>
<li>Returns: The String representation of the threat triage rules</li>
</ul></li>
<li><tt>THREAT_TRIAGE_PRINT</tt>
<ul>
<li>Description: Retrieve stellar enrichment transformations.</li>
<li>Input:
<ul>
<li>sensorConfig - Sensor config to add transformation to.</li>
</ul></li>
<li>Returns: The String representation of the threat triage rules</li>
</ul></li>
<li><tt>THREAT_TRIAGE_REMOVE</tt>
<ul>
<li>Description: Remove stellar threat triage rule(s).</li>
<li>Input:
<ul>
<li>sensorConfig - Sensor config to add transformation to.</li>
<li>rules - A list of stellar rules or rule names to remove</li>
</ul></li>
<li>Returns: The String representation of the enrichment config</li>
</ul></li>
<li><tt>THREAT_TRIAGE_SET_AGGREGATOR</tt>
<ul>
<li>Description: Set the threat triage aggregator.</li>
<li>Input:
<ul>
<li>sensorConfig - Sensor config to add transformation to.</li>
<li>aggregator - Aggregator to use. One of MIN, MAX, MEAN, SUM, POSITIVE_MEAN</li>
<li>aggregatorConfig - Optional config for aggregator</li>
</ul></li>
<li>Returns: The String representation of the enrichment config</li>
</ul></li>
</ul></div></div>
<div class="section">
<h2><a name="Deployment_Instructions"></a>Deployment Instructions</h2>
<p>Deployment is as simple as dropping the jar created by this project into <tt>$METRON_HOME/lib</tt> and starting the Stellar shell via <tt>$METRON_HOME/bin/stellar</tt></p></div>
<div class="section">
<h2><a name="Examples"></a>Examples</h2>
<p>Included for description and education purposes are a couple example Stellar REPL transcripts with helpful comments to illustrate some common operations.</p>
<div class="section">
<h3><a name="Iterate_in_finding_a_valid_Grok_pattern"></a>Iterate in finding a valid Grok pattern</h3>
<div class="source">
<div class="source">
<pre>Stellar, Go!
Please note that functions are loading lazily in the background and will be unavailable until loaded fully.
[Stellar]&gt;&gt;&gt; # We are going to debug a squid grok statement with a bug in it
[Stellar]&gt;&gt;&gt; squid_grok_orig := '%{NUMBER:timestamp} %{SPACE:UNWANTED} %{INT:elapsed} %{IP:ip_src_addr} %{WORD:action}/%{NUMBER:code} %{NUMBER:bytes} %{WORD:method} %{NOTSPACE:url}
- %{WORD:UNWANTED}/%{IP:ip_dst_addr} %{WORD:UNWANTED}/%{WORD:UNWANTED}'
[Stellar]&gt;&gt;&gt; # We have gone ot a couple of domains in squid:
[Stellar]&gt;&gt;&gt; # 1475022887.362 256 127.0.0.1 TCP_MISS/301 803 GET http://www.youtube.com/ - DIRECT/216.58.216.238 text/html
[Stellar]&gt;&gt;&gt; # 1475022915.731 1 127.0.0.1 NONE/400 3520 GET flimflammadeupdomain.com - NONE/- text/html
[Stellar]&gt;&gt;&gt; # 1475022938.661 0 127.0.0.1 NONE/400 3500 GET www.google.com - NONE/- text/html
[Stellar]&gt;&gt;&gt; # Note that flimflammadeupdomain.com and www.google.com did not resolve to IPs
[Stellar]&gt;&gt;&gt; # We can load up these messages from disk into a list of messages
[Stellar]&gt;&gt;&gt; messages := LOCAL_READ_LINES( '/var/log/squid/access.log')
27687 [Thread-1] INFO o.r.Reflections - Reflections took 26542 ms to scan 22 urls, producing 17906 keys and 121560 values
27837 [Thread-1] INFO o.a.m.c.d.FunctionResolverSingleton - Found 97 Stellar Functions...
Functions loaded, you may refer to functions now...
[Stellar]&gt;&gt;&gt; # and evaluate the messages against our grok statement
[Stellar]&gt;&gt;&gt; GROK_EVAL(squid_grok_orig, messages)
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; action &#x2502; bytes &#x2502; code &#x2502; elapsed &#x2502; ip_dst_addr &#x2502; ip_src_addr &#x2502; method &#x2502; timestamp &#x2502; url &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; TCP_MISS &#x2502; 803 &#x2502; 301 &#x2502; 256 &#x2502; 216.58.216.238 &#x2502; 127.0.0.1 &#x2502; GET &#x2502; 1475022887.362 &#x2502; http://www.youtube.com/ &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; # Uh oh, looks like the messages without destination IPs do not parse
[Stellar]&gt;&gt;&gt; # We can start peeling off groups from the end of the message until things parse
[Stellar]&gt;&gt;&gt; squid_grok := '%{NUMBER:timestamp} %{SPACE:UNWANTED} %{INT:elapsed} %{IP:ip_src_addr} %{WORD:action}/%{NUMBER:code} %{NUMBER:bytes} %{WORD:method} %{NOTSPACE:url} - %{
WORD:UNWANTED}/%{IP:ip_dst_addr}'
[Stellar]&gt;&gt;&gt; GROK_EVAL(squid_grok, messages)
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; action &#x2502; bytes &#x2502; code &#x2502; elapsed &#x2502; ip_dst_addr &#x2502; ip_src_addr &#x2502; method &#x2502; timestamp &#x2502; url &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; TCP_MISS &#x2502; 803 &#x2502; 301 &#x2502; 256 &#x2502; 216.58.216.238 &#x2502; 127.0.0.1 &#x2502; GET &#x2502; 1475022887.362 &#x2502; http://www.youtube.com/ &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; # Still looks like it is having issues...
[Stellar]&gt;&gt;&gt; squid_grok := '%{NUMBER:timestamp} %{SPACE:UNWANTED} %{INT:elapsed} %{IP:ip_src_addr} %{WORD:action}/%{NUMBER:code} %{NUMBER:bytes} %{WORD:method} %{NOTSPACE:url} - %{
WORD:UNWANTED}/%{IP:ip_dst_addr}'
[Stellar]&gt;&gt;&gt; GROK_EVAL(squid_grok, messages)
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; action &#x2502; bytes &#x2502; code &#x2502; elapsed &#x2502; ip_dst_addr &#x2502; ip_src_addr &#x2502; method &#x2502; timestamp &#x2502; url &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; TCP_MISS &#x2502; 803 &#x2502; 301 &#x2502; 256 &#x2502; 216.58.216.238 &#x2502; 127.0.0.1 &#x2502; GET &#x2502; 1475022887.362 &#x2502; http://www.youtube.com/ &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2502; MISSING &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; # Still looks wrong. Hmm, I bet it is due to that dst_addr not being there; we can make it optional
[Stellar]&gt;&gt;&gt; squid_grok := '%{NUMBER:timestamp} %{SPACE:UNWANTED} %{INT:elapsed} %{IP:ip_src_addr} %{WORD:action}/%{NUMBER:code} %{NUMBER:bytes} %{WORD:method} %{NOTSPACE:url} - %{
WORD:UNWANTED}/(%{IP:ip_dst_addr})?'
[Stellar]&gt;&gt;&gt; GROK_EVAL(squid_grok, messages)
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; action &#x2502; bytes &#x2502; code &#x2502; elapsed &#x2502; ip_dst_addr &#x2502; ip_src_addr &#x2502; method &#x2502; timestamp &#x2502; url &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; TCP_MISS &#x2502; 803 &#x2502; 301 &#x2502; 256 &#x2502; 216.58.216.238 &#x2502; 127.0.0.1 &#x2502; GET &#x2502; 1475022887.362 &#x2502; http://www.youtube.com/ &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; NONE &#x2502; 3520 &#x2502; 400 &#x2502; 1 &#x2502; null &#x2502; 127.0.0.1 &#x2502; GET &#x2502; 1475022915.731 &#x2502; flimflammadeupdomain.com &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; NONE &#x2502; 3500 &#x2502; 400 &#x2502; 0 &#x2502; null &#x2502; 127.0.0.1 &#x2502; GET &#x2502; 1475022938.661 &#x2502; www.google.com &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; # Ahh, that is much better.
[Stellar]&gt;&gt;&gt;
[Stellar]&gt;&gt;&gt;
</pre></div></div></div>
<div class="section">
<h3><a name="Manage_Stellar_Field_Transformations"></a>Manage Stellar Field Transformations</h3>
<div class="source">
<div class="source">
<pre>964 [main] INFO o.a.c.f.i.CuratorFrameworkImpl - Starting
1025 [main-EventThread] INFO o.a.c.f.s.ConnectionStateManager - State change: CONNECTED
Stellar, Go!
Please note that functions are loading lazily in the background and will be unavailable until loaded fully.
{es.clustername=metron, es.ip=node1, es.port=9300, es.date.format=yyyy.MM.dd.HH}
[Stellar]&gt;&gt;&gt; # First we get the squid parser config from zookeeper
[Stellar]&gt;&gt;&gt; squid_parser_config := CONFIG_GET('PARSER', 'squid')
29089 [Thread-1] INFO o.r.Reflections - Reflections took 26765 ms to scan 22 urls, producing 17898 keys and 121518 values
29177 [Thread-1] INFO o.a.m.c.d.FunctionResolverSingleton - Found 83 Stellar Functions...
Functions loaded, you may refer to functions now...
[Stellar]&gt;&gt;&gt; # See what kind of transformations it already has
[Stellar]&gt;&gt;&gt; PARSER_STELLAR_TRANSFORM_PRINT(squid_parser_config)
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Field &#x2502; Transformation &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; full_hostname &#x2502; URL_TO_HOST(url) &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; domain_without_subdomains &#x2502; DOMAIN_REMOVE_SUBDOMAINS(full_hostname) &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; #Just to make sure it looks right, we can view the JSON
[Stellar]&gt;&gt;&gt; squid_parser_config
{
&quot;parserClassName&quot;: &quot;org.apache.metron.parsers.GrokParser&quot;,
&quot;sensorTopic&quot;: &quot;squid&quot;,
&quot;parserConfig&quot;: {
&quot;grokPath&quot;: &quot;/patterns/squid&quot;,
&quot;patternLabel&quot;: &quot;SQUID_DELIMITED&quot;,
&quot;timestampField&quot;: &quot;timestamp&quot;
},
&quot;fieldTransformations&quot; : [
{
&quot;transformation&quot; : &quot;STELLAR&quot;
,&quot;output&quot; : [ &quot;full_hostname&quot;, &quot;domain_without_subdomains&quot; ]
,&quot;config&quot; : {
&quot;full_hostname&quot; : &quot;URL_TO_HOST(url)&quot;
,&quot;domain_without_subdomains&quot; : &quot;DOMAIN_REMOVE_SUBDOMAINS(full_hostname)&quot;
}
}
]
}
[Stellar]&gt;&gt;&gt; # Add another transformation in there
[Stellar]&gt;&gt;&gt; domain_without_subdomains := 'cnn.com'
[Stellar]&gt;&gt;&gt; upper_domain := TO_UPPER(domain_without_subdomains)
[Stellar]&gt;&gt;&gt; # Now we can look at our variables and see what expressions created them
[Stellar]&gt;&gt;&gt; # NOTE: the 40 is the max char for a word
[Stellar]&gt;&gt;&gt; SHELL_LIST_VARS( 40 )
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; VARIABLE &#x2502; VALUE &#x2502; EXPRESSION &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; squid_parser_config &#x2502; { &#x2502; CONFIG_GET('PARSER', 'squid') &#x2551;
&#x2551; &#x2502; &quot;parserClassName&quot;: &#x2502; &#x2551;
&#x2551; &#x2502; &quot;org.apache.metron.parsers.GrokParser&quot;, &#x2502; &#x2551;
&#x2551; &#x2502; &#x2502; &#x2551;
&#x2551; &#x2502; &quot;sensorTopic&quot;: &quot;squid&quot;, &#x2502; &#x2551;
&#x2551; &#x2502; &#x2502; &#x2551;
&#x2551; &#x2502; &quot;parserConfig&quot;: { &#x2502; &#x2551;
&#x2551; &#x2502; &quot;grokPath&quot;: &#x2502; &#x2551;
&#x2551; &#x2502; &quot;/patterns/squid&quot;, &#x2502; &#x2551;
&#x2551; &#x2502; &quot;patternLabel&quot;: &#x2502; &#x2551;
&#x2551; &#x2502; &quot;SQUID_DELIMITED&quot;, &#x2502; &#x2551;
&#x2551; &#x2502; &quot;timestampField&quot;: &#x2502; &#x2551;
&#x2551; &#x2502; &quot;timestamp&quot; &#x2502; &#x2551;
&#x2551; &#x2502; }, &#x2502; &#x2551;
&#x2551; &#x2502; &#x2502; &#x2551;
&#x2551; &#x2502; &quot;fieldTransformations&quot; : [ &#x2502; &#x2551;
&#x2551; &#x2502; { &#x2502; &#x2551;
&#x2551; &#x2502; &#x2502; &#x2551;
&#x2551; &#x2502; &quot;transformation&quot; : &quot;STELLAR&quot; &#x2502; &#x2551;
&#x2551; &#x2502; &#x2502; &#x2551;
&#x2551; &#x2502; ,&quot;output&quot; : [ &quot;full_hostname&quot;, &#x2502; &#x2551;
&#x2551; &#x2502; &quot;domain_without_subdomains&quot; ] &#x2502; &#x2551;
&#x2551; &#x2502; &#x2502; &#x2551;
&#x2551; &#x2502; ,&quot;config&quot; : { &#x2502; &#x2551;
&#x2551; &#x2502; &quot;full_hostname&quot; : &#x2502; &#x2551;
&#x2551; &#x2502; &quot;URL_TO_HOST(url)&quot; &#x2502; &#x2551;
&#x2551; &#x2502; &#x2502; &#x2551;
&#x2551; &#x2502; ,&quot;domain_without_subdomains&quot; : &#x2502; &#x2551;
&#x2551; &#x2502; &quot;DOMAIN_REMOVE_SUBDOMAINS(full_hostname)&quot; &#x2502; &#x2551;
&#x2551; &#x2502; &#x2502; &#x2551;
&#x2551; &#x2502; } &#x2502; &#x2551;
&#x2551; &#x2502; } &#x2502; &#x2551;
&#x2551; &#x2502; ] &#x2502; &#x2551;
&#x2551; &#x2502; } &#x2502; &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; domain_without_subdomains &#x2502; cnn.com &#x2502; 'cnn.com' &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; upper_domain &#x2502; CNN.COM &#x2502; TO_UPPER(domain_without_subdomains) &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; # We can add upper_domain as a transformation to the parser now by
[Stellar]&gt;&gt;&gt; ?PARSER_STELLAR_TRANSFORM_ADD
PARSER_STELLAR_TRANSFORM_ADD
Description: Add stellar field transformation.
Arguments:
sensorConfig - Sensor config to add transformation to.
stellarTransforms - A Map associating fields to stellar expressions
Returns: The String representation of the config in zookeeper
[Stellar]&gt;&gt;&gt; # We will use the SHELL_VARS2MAP to construct our map associating the field name with the expression
[Stellar]&gt;&gt;&gt; ?SHELL_VARS2MAP
SHELL_VARS2MAP
Description: Take a set of variables and return a map
Arguments:
variables* - variable names to use to create map
Returns: A map associating the variable name with the stellar expression.
[Stellar]&gt;&gt;&gt; squid_parser_config_new := PARSER_STELLAR_TRANSFORM_ADD( squid_parser_config, SHELL_VARS2MAP('upper_domain') )
[Stellar]&gt;&gt;&gt; #Now we can make sure that we have the transformation added
[Stellar]&gt;&gt;&gt; PARSER_STELLAR_TRANSFORM_PRINT(squid_parser_config_new)
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Field &#x2502; Transformation &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; full_hostname &#x2502; URL_TO_HOST(url) &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; domain_without_subdomains &#x2502; DOMAIN_REMOVE_SUBDOMAINS(full_hostname) &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; upper_domain &#x2502; TO_UPPER(domain_without_subdomains) &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; #And finally, we push the configs back to zookeeper
[Stellar]&gt;&gt;&gt; CONFIG_PUT('PARSER', squid_parser_config_new, 'squid')
[Stellar]&gt;&gt;&gt; #Now we can make sure that we have the transformation added into zookeeper
[Stellar]&gt;&gt;&gt; PARSER_STELLAR_TRANSFORM_PRINT(CONFIG_GET('PARSER', 'squid'))
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Field &#x2502; Transformation &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; full_hostname &#x2502; URL_TO_HOST(url) &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; domain_without_subdomains &#x2502; DOMAIN_REMOVE_SUBDOMAINS(full_hostname) &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; upper_domain &#x2502; TO_UPPER(domain_without_subdomains) &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; #Now that we have added it, we can change our mind and remove it
[Stellar]&gt;&gt;&gt; ?PARSER_STELLAR_TRANSFORM_REMOVE
PARSER_STELLAR_TRANSFORM_REMOVE
Description: Remove stellar field transformation.
Arguments:
sensorConfig - Sensor config to add transformation to.
stellarTransforms - A list of stellar transforms to remove
Returns: The String representation of the config in zookeeper
[Stellar]&gt;&gt;&gt; squid_parser_config_new := PARSER_STELLAR_TRANSFORM_REMOVE( CONFIG_GET('PARSER', 'squid'), [ 'upper_domain' ] )
[Stellar]&gt;&gt;&gt; PARSER_STELLAR_TRANSFORM_PRINT(squid_parser_config_new)
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Field &#x2502; Transformation &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; full_hostname &#x2502; URL_TO_HOST(url) &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; domain_without_subdomains &#x2502; DOMAIN_REMOVE_SUBDOMAINS(full_hostname) &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; #We can now push up the config to zookeeper
[Stellar]&gt;&gt;&gt; CONFIG_PUT('PARSER', squid_parser_config_new, 'squid')
[Stellar]&gt;&gt;&gt; #It should be just as we started the exercise
[Stellar]&gt;&gt;&gt; CONFIG_GET('PARSER', 'squid')
{
&quot;parserClassName&quot; : &quot;org.apache.metron.parsers.GrokParser&quot;,
&quot;sensorTopic&quot; : &quot;squid&quot;,
&quot;parserConfig&quot; : {
&quot;grokPath&quot; : &quot;/patterns/squid&quot;,
&quot;patternLabel&quot; : &quot;SQUID_DELIMITED&quot;,
&quot;timestampField&quot; : &quot;timestamp&quot;
},
&quot;fieldTransformations&quot; : [ {
&quot;input&quot; : [ ],
&quot;output&quot; : [ &quot;full_hostname&quot;, &quot;domain_without_subdomains&quot; ],
&quot;transformation&quot; : &quot;STELLAR&quot;,
&quot;config&quot; : {
&quot;full_hostname&quot; : &quot;URL_TO_HOST(url)&quot;,
&quot;domain_without_subdomains&quot; : &quot;DOMAIN_REMOVE_SUBDOMAINS(full_hostname)&quot;
}
} ]
}
[Stellar]&gt;&gt;&gt; #And quit the REPL
[Stellar]&gt;&gt;&gt; quit
</pre></div></div></div>
<div class="section">
<h3><a name="Manage_Stellar_Enrichments"></a>Manage Stellar Enrichments</h3>
<div class="source">
<div class="source">
<pre>1010 [main] INFO o.a.c.f.i.CuratorFrameworkImpl - Starting
1077 [main-EventThread] INFO o.a.c.f.s.ConnectionStateManager - State change: CONNECTED
Stellar, Go!
Please note that functions are loading lazily in the background and will be unavailable until loaded fully.
{es.clustername=metron, es.ip=node1, es.port=9300, es.date.format=yyyy.MM.dd.HH}
[Stellar]&gt;&gt;&gt; # First we get the squid enrichment config from zookeeper.
[Stellar]&gt;&gt;&gt; # If it is not there, which it is not by default, a suitable default
[Stellar]&gt;&gt;&gt; # config will be specified.
[Stellar]&gt;&gt;&gt; squid_enrichment_config := CONFIG_GET('ENRICHMENT', 'squid')
26307 [Thread-1] INFO o.r.Reflections - Reflections took 24845 ms to scan 22 urls, producing 17898 keys and 121520 values
26389 [Thread-1] INFO o.a.m.c.d.FunctionResolverSingleton - Found 84 Stellar Functions...
Functions loaded, you may refer to functions now...
[Stellar]&gt;&gt;&gt; # Just to make sure it looks right, we can view the JSON
[Stellar]&gt;&gt;&gt; squid_enrichment_config
{
&quot;enrichment&quot; : {
&quot;fieldMap&quot; : { },
&quot;fieldToTypeMap&quot; : { },
&quot;config&quot; : { }
},
&quot;threatIntel&quot; : {
&quot;fieldMap&quot; : { },
&quot;fieldToTypeMap&quot; : { },
&quot;config&quot; : { },
&quot;triageConfig&quot; : {
&quot;riskLevelRules&quot; : [ ],
&quot;aggregator&quot; : &quot;MAX&quot;,
&quot;aggregationConfig&quot; : { }
}
},
&quot;configuration&quot; : { }
}
[Stellar]&gt;&gt;&gt; # Now that we have a config, we can add an enrichment to the Stellar adapter
[Stellar]&gt;&gt;&gt; # We should make sure that the current enrichment does not have any already
[Stellar]&gt;&gt;&gt; ?ENRICHMENT_STELLAR_TRANSFORM_PRINT
ENRICHMENT_STELLAR_TRANSFORM_PRINT
Description: Retrieve stellar enrichment transformations.
Arguments:
sensorConfig - Sensor config to add transformation to.
type - ENRICHMENT or THREAT_INTEL
Returns: The String representation of the transformations
[Stellar]&gt;&gt;&gt; # Since there are two places we can add enrichments, we should check both
[Stellar]&gt;&gt;&gt; ENRICHMENT_STELLAR_TRANSFORM_PRINT(squid_enrichment_config, 'ENRICHMENT')
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Group &#x2502; Field &#x2502; Transformation &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; (empty) &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; ENRICHMENT_STELLAR_TRANSFORM_PRINT(squid_enrichment_config, 'THREAT_INTEL')
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Group &#x2502; Field &#x2502; Transformation &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; (empty) &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; # For my enrichment, I want to add a field indicating that the src address is local or not
[Stellar]&gt;&gt;&gt; # I will define local as part of '192.168.0.0/21'
[Stellar]&gt;&gt;&gt; # We must be careful about the ip_src_addr, what if it is malformed?
[Stellar]&gt;&gt;&gt; ip_src_addr := '200.20.10.1'
[Stellar]&gt;&gt;&gt; IN_SUBNET( ip_src_addr, '192.168.0.0/21')
false
[Stellar]&gt;&gt;&gt; # Just as we expected. Now we can try a local address
[Stellar]&gt;&gt;&gt; ip_src_addr := '192.168.0.1'
[Stellar]&gt;&gt;&gt; IN_SUBNET( ip_src_addr, '192.168.0.0/21')
true
[Stellar]&gt;&gt;&gt; # Just as we expected. Now we can try some malformed ones
[Stellar]&gt;&gt;&gt; ip_src_addr := NULL
[Stellar]&gt;&gt;&gt; IN_SUBNET( ip_src_addr, '192.168.0.0/21')
false
[Stellar]&gt;&gt;&gt; # So far, so good
[Stellar]&gt;&gt;&gt; ip_src_addr := 'foo bar'
[Stellar]&gt;&gt;&gt; IN_SUBNET( ip_src_addr, '192.168.0.0/21')
[!] Unable to execute: Could not parse [foo bar]
[Stellar]&gt;&gt;&gt; # uh oh, that was terrible, we will have to adjust and be a bit more defensive
[Stellar]&gt;&gt;&gt; IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21')
false
[Stellar]&gt;&gt;&gt; ip_src_addr := NULL
[Stellar]&gt;&gt;&gt; IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21')
false
[Stellar]&gt;&gt;&gt; ip_src_addr := '192.168.0.1'
[Stellar]&gt;&gt;&gt; IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21')
true
[Stellar]&gt;&gt;&gt; ip_src_addr := '200.20.10.1'
[Stellar]&gt;&gt;&gt; IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21')
false
[Stellar]&gt;&gt;&gt; # I think we are ready, we will call it is_local
[Stellar]&gt;&gt;&gt; is_local := IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21')
[Stellar]&gt;&gt;&gt; # Now we can add the function to the ENRICHMENT phase of the enrichment topology
[Stellar]&gt;&gt;&gt; ?ENRICHMENT_STELLAR_TRANSFORM_ADD
ENRICHMENT_STELLAR_TRANSFORM_ADD
Description: Add stellar field transformation.
Arguments:
sensorConfig - Sensor config to add transformation to.
type - ENRICHMENT or THREAT_INTEL
stellarTransforms - A Map associating fields to stellar expressions
group - Group to add to (optional)
Returns: The String representation of the config in zookeeper
[Stellar]&gt;&gt;&gt; squid_enrichment_config_new := ENRICHMENT_STELLAR_TRANSFORM_ADD( squid_enrichment_config, 'ENRICHMENT', SHELL_VARS2MAP( 'is_local' ) )
[Stellar]&gt;&gt;&gt; # Make sure that it is really there
[Stellar]&gt;&gt;&gt; ENRICHMENT_STELLAR_TRANSFORM_PRINT(squid_enrichment_config_new, 'ENRICHMENT')
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Group &#x2502; Field &#x2502; Transformation &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; (default) &#x2502; is_local &#x2502; IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21') &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; # and not in threat intel
[Stellar]&gt;&gt;&gt; ENRICHMENT_STELLAR_TRANSFORM_PRINT(squid_enrichment_config_new, 'THREAT_INTEL')
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Group &#x2502; Field &#x2502; Transformation &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; (empty) &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; # And see it in the JSON
[Stellar]&gt;&gt;&gt; squid_enrichment_config_new
{
&quot;index&quot; : &quot;squid&quot;,
&quot;batchSize&quot; : 100,
&quot;enrichment&quot; : {
&quot;fieldMap&quot; : {
&quot;stellar&quot; : {
&quot;config&quot; : {
&quot;is_local&quot; : &quot;IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21')&quot;
}
}
},
&quot;fieldToTypeMap&quot; : { },
&quot;config&quot; : { }
},
&quot;threatIntel&quot; : {
&quot;fieldMap&quot; : { },
&quot;fieldToTypeMap&quot; : { },
&quot;config&quot; : { },
&quot;triageConfig&quot; : {
&quot;riskLevelRules&quot; : [ ],
&quot;aggregator&quot; : &quot;MAX&quot;,
&quot;aggregationConfig&quot; : { }
}
},
&quot;configuration&quot; : { }
}
[Stellar]&gt;&gt;&gt; # Now we can push the configs to zookeeper
[Stellar]&gt;&gt;&gt; CONFIG_PUT( 'ENRICHMENT', squid_enrichment_config_new, 'squid')
[Stellar]&gt;&gt;&gt; # And validate that our JSON looks a lot better
[Stellar]&gt;&gt;&gt; CONFIG_GET( 'ENRICHMENT', 'squid')
{
&quot;index&quot; : &quot;squid&quot;,
&quot;batchSize&quot; : 100,
&quot;enrichment&quot; : {
&quot;fieldMap&quot; : {
&quot;stellar&quot; : {
&quot;config&quot; : {
&quot;is_local&quot; : &quot;IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21')&quot;
}
}
},
&quot;fieldToTypeMap&quot; : { },
&quot;config&quot; : { }
},
&quot;threatIntel&quot; : {
&quot;fieldMap&quot; : { },
&quot;fieldToTypeMap&quot; : { },
&quot;config&quot; : { },
&quot;triageConfig&quot; : {
&quot;riskLevelRules&quot; : [ ],
&quot;aggregator&quot; : &quot;MAX&quot;,
&quot;aggregationConfig&quot; : { }
}
},
&quot;configuration&quot; : { }
}
[Stellar]&gt;&gt;&gt; # You know what? I changed my mind, I do not want that enrichment, so we can remove it pretty easily.
[Stellar]&gt;&gt;&gt; ?ENRICHMENT_STELLAR_TRANSFORM_REMOVE
ENRICHMENT_STELLAR_TRANSFORM_REMOVE
Description: Remove one or more stellar field transformations.
Arguments:
sensorConfig - Sensor config to add transformation to.
type - ENRICHMENT or THREAT_INTEL
stellarTransforms - A list of removals
group - Group to remove from (optional)
Returns: The String representation of the config in zookeeper
[Stellar]&gt;&gt;&gt; squid_enrichment_config_new := ENRICHMENT_STELLAR_TRANSFORM_REMOVE( squid_enrichment_config_new, 'ENRICHMENT', [ 'is_local' ] )
[Stellar]&gt;&gt;&gt; # Make sure that it is really gone
[Stellar]&gt;&gt;&gt; ENRICHMENT_STELLAR_TRANSFORM_PRINT(squid_enrichment_config_new, 'ENRICHMENT')
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Group &#x2502; Field &#x2502; Transformation &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; (empty) &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; # and not in threat intel
[Stellar]&gt;&gt;&gt; ENRICHMENT_STELLAR_TRANSFORM_PRINT(squid_enrichment_config_new, 'THREAT_INTEL')
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Group &#x2502; Field &#x2502; Transformation &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; (empty) &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; # Ok, I feel comfortable updating now
[Stellar]&gt;&gt;&gt; CONFIG_PUT( 'ENRICHMENT', squid_enrichment_config_new, 'squid')
[Stellar]&gt;&gt;&gt; CONFIG_GET( 'ENRICHMENT', 'squid')
{
&quot;index&quot; : &quot;squid&quot;,
&quot;batchSize&quot; : 100,
&quot;enrichment&quot; : {
&quot;fieldMap&quot; : { },
&quot;fieldToTypeMap&quot; : { },
&quot;config&quot; : { }
},
&quot;threatIntel&quot; : {
&quot;fieldMap&quot; : { },
&quot;fieldToTypeMap&quot; : { },
&quot;config&quot; : { },
&quot;triageConfig&quot; : {
&quot;riskLevelRules&quot; : [ ],
&quot;aggregator&quot; : &quot;MAX&quot;,
&quot;aggregationConfig&quot; : { }
}
},
&quot;configuration&quot; : { }
}
[Stellar]&gt;&gt;&gt;
</pre></div></div></div>
<div class="section">
<h3><a name="Manage_Threat_Triage_Rules"></a>Manage Threat Triage Rules</h3>
<div class="source">
<div class="source">
<pre>987 [main] INFO o.a.c.f.i.CuratorFrameworkImpl - Starting
1047 [main-EventThread] INFO o.a.c.f.s.ConnectionStateManager - State change: CONNECTED
Stellar, Go!
Please note that functions are loading lazily in the background and will be unavailable until loaded fully.
{es.clustername=metron, es.ip=node1, es.port=9300, es.date.format=yyyy.MM.dd.HH}
[Stellar]&gt;&gt;&gt; # First we get the squid enrichment config from zookeeper.
[Stellar]&gt;&gt;&gt; # If it is not there, which it is not by default, a suitable default
[Stellar]&gt;&gt;&gt; # config will be specified.
[Stellar]&gt;&gt;&gt; squid_enrichment_config := CONFIG_GET('ENRICHMENT', 'squid')
26751 [Thread-1] INFO o.r.Reflections - Reflections took 24407 ms to scan 22 urls, producing 17898 keys and 121520 values
26828 [Thread-1] INFO o.a.m.c.d.FunctionResolverSingleton - Found 84 Stellar Functions...
Functions loaded, you may refer to functions now...
[Stellar]&gt;&gt;&gt; # We should not have any threat triage rules
[Stellar]&gt;&gt;&gt; THREAT_TRIAGE_PRINT(squid_enrichment_config)
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Triage Rule &#x2502; Score &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; (empty) &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; # I have followed the blog post at https://cwiki.apache.org/confluence/display/METRON/2016/04/28/Metron+Tutorial+-+Fundamentals+Part+2%3A+Creating+a+New+Enrichment
[Stellar]&gt;&gt;&gt; # and have some enrichment reference data loaded into hbase,
[Stellar]&gt;&gt;&gt; # so we should be able to retrieve that as an enrichment using the ENRICHMENT_GET
[Stellar]&gt;&gt;&gt; # function to call out to hbase from stellar
[Stellar]&gt;&gt;&gt; ?ENRICHMENT_GET
ENRICHMENT_GET
Description: Interrogates the HBase table holding the simple hbase enrichment data and retrieves the tabular value associated with the enrichment type and indicator.
Arguments:
enrichment_type - The enrichment type
indicator - The string indicator to look up
nosql_table - The NoSQL Table to use
column_family - The Column Family to use
Returns: A Map associated with the indicator and enrichment type. Empty otherwise.
[Stellar]&gt;&gt;&gt; domain_without_subdomains := 'cnn.com'
[Stellar]&gt;&gt;&gt; whois_info := ENRICHMENT_GET('whois', domain_without_subdomains, 'enrichment', 't')
[Stellar]&gt;&gt;&gt; # Now I know that the whois_info is actually a map of values, so we can use the SHELL_MAP2TABLE function
[Stellar]&gt;&gt;&gt; # to get a nicer view on this data
[Stellar]&gt;&gt;&gt; SHELL_MAP2TABLE(whois_info)
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; KEY &#x2502; VALUE &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; owner &#x2502; Turner Broadcasting System, Inc. &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; registrar &#x2502; Domain Name Manager &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; domain_created_timestamp &#x2502; 748695600000 &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; home_country &#x2502; US &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; domain &#x2502; cnn.com &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; #Looks good
[Stellar]&gt;&gt;&gt; squid_enrichment_config_new := ENRICHMENT_STELLAR_TRANSFORM_ADD( squid_enrichment_config, 'ENRICHMENT', SHELL_VARS2MAP( 'whois_info' ) )
[Stellar]&gt;&gt;&gt; # Just for illustration, we can create a threat alert if the country of the domain registered
[Stellar]&gt;&gt;&gt; # is non-US, then we can make an alert. To do that, we need to create an is_alert field on the message.
[Stellar]&gt;&gt;&gt; #
[Stellar]&gt;&gt;&gt; # I know that maps get folded into the message, so that whois_info enrichment is going to create a few fields:
[Stellar]&gt;&gt;&gt; # * domain mapped to whois_info.domain
[Stellar]&gt;&gt;&gt; # * registrar mapped to whois_info.registrar
[Stellar]&gt;&gt;&gt; # * home_country mapped to whois_info.home_country
[Stellar]&gt;&gt;&gt; # * owner mapped to whois_info.owner
[Stellar]&gt;&gt;&gt; whois_info.home_country := 'US'
[Stellar]&gt;&gt;&gt; is_alert := whois_info.home_country != 'US'
[Stellar]&gt;&gt;&gt; # Now we can add this Stellar enrichment to the THREAT_INTEL portion of the enrichment topology
[Stellar]&gt;&gt;&gt; squid_enrichment_config_new := ENRICHMENT_STELLAR_TRANSFORM_ADD( squid_enrichment_config_new, 'THREAT_INTEL', SHELL_VARS2MAP( 'is_alert' ) )
[Stellar]&gt;&gt;&gt; # We should recap to make sure we know what enrichments we have
[Stellar]&gt;&gt;&gt; ENRICHMENT_STELLAR_TRANSFORM_PRINT(squid_enrichment_config_new, 'ENRICHMENT')
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Group &#x2502; Field &#x2502; Transformation &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; (default) &#x2502; whois_info &#x2502; ENRICHMENT_GET('whois', domain_without_subdomains, 'enrichment', 't') &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; ENRICHMENT_STELLAR_TRANSFORM_PRINT(squid_enrichment_config_new, 'THREAT_INTEL')
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Group &#x2502; Field &#x2502; Transformation &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; (default) &#x2502; is_alert &#x2502; whois_info.home_country != 'US' &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; # Now with this, we can create a rule or two to triage these alerts.
[Stellar]&gt;&gt;&gt; # This means associating a rule as described by a stellar expression that returns true or false with a score
[Stellar]&gt;&gt;&gt; # Also associated with this ruleset is an aggregation function, the default of which is MAX.
[Stellar]&gt;&gt;&gt; # Now we can make a couple rules:
[Stellar]&gt;&gt;&gt; # * If the message is an alert and from a non-us whois source, we can set the level to 10
[Stellar]&gt;&gt;&gt; # * If the message is an alert and non-local, we can set the level to 20
[Stellar]&gt;&gt;&gt; # * If the message is an alert and both non-local and non-us, then we can set the level to 50
[Stellar]&gt;&gt;&gt; # If multiple rules hit, then we should take the max (default behavior)
[Stellar]&gt;&gt;&gt; non_us := whois_info.home_country != 'US'
[Stellar]&gt;&gt;&gt; is_local := IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21')
[Stellar]&gt;&gt;&gt; is_both := whois_info.home_country != 'US' &amp;&amp; IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21')
[Stellar]&gt;&gt;&gt; rules := [ { 'name' : 'is non-us', 'rule' : SHELL_GET_EXPRESSION('non_us'), 'score' : 10 } , { 'name' : 'is local', 'rule' : SHELL_GET_EXPRESSION('is_local '), 'score' : 20 } , { 'name' : 'both non-us and local', 'comment' : 'union of both rules.', 'rule' : SHELL_GET_EXPRESSION('is_both'), 'score' : 50 } ]
[Stellar]&gt;&gt;&gt; # Now that we have our rules staged, we can add them to our config.
[Stellar]&gt;&gt;&gt; squid_enrichment_config_new := THREAT_TRIAGE_ADD( squid_enrichment_config_new, rules )
[Stellar]&gt;&gt;&gt; THREAT_TRIAGE_PRINT(squid_enrichment_config_new)
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Name &#x2502; Comment &#x2502; Triage Rule &#x2502; Score &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x256a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; is non-us &#x2502; &#x2502; whois_info.home_country != 'US' &#x2502; 10 &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; is local &#x2502; &#x2502; IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21') &#x2502; 20 &#x2551;
&#x255f;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x253c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2562;
&#x2551; both non-us and local &#x2502; union of both rules. &#x2502; whois_info.home_country != 'US' &amp;&amp; IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21') &#x2502; 50 &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
Aggregation: MAX
[Stellar]&gt;&gt;&gt; # Looks good, we can push the configs up
[Stellar]&gt;&gt;&gt; CONFIG_PUT('ENRICHMENT', squid_enrichment_config_new, 'squid')
[Stellar]&gt;&gt;&gt; # And admire the resulting JSON that you did not have to edit directly.
[Stellar]&gt;&gt;&gt; CONFIG_GET('ENRICHMENT', 'squid')
{
&quot;enrichment&quot; : {
&quot;fieldMap&quot; : {
&quot;stellar&quot; : {
&quot;config&quot; : {
&quot;whois_info&quot; : &quot;ENRICHMENT_GET('whois', domain_without_subdomains, 'enrichment', 't')&quot;
}
}
},
&quot;fieldToTypeMap&quot; : { },
&quot;config&quot; : { }
},
&quot;threatIntel&quot; : {
&quot;fieldMap&quot; : {
&quot;stellar&quot; : {
&quot;config&quot; : {
&quot;is_alert&quot; : &quot;whois_info.home_country != 'US'&quot;
}
}
},
&quot;fieldToTypeMap&quot; : { },
&quot;config&quot; : { },
&quot;triageConfig&quot; : {
&quot;riskLevelRules&quot; : [ {
&quot;name&quot; : &quot;is non-us&quot;,
&quot;rule&quot; : &quot;whois_info.home_country != 'US'&quot;,
&quot;score&quot; : 10.0
}, {
&quot;name&quot; : &quot;is local&quot;,
&quot;rule&quot; : &quot;IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21')&quot;,
&quot;score&quot; : 20.0
}, {
&quot;name&quot; : &quot;both non-us and local&quot;,
&quot;comment&quot; : &quot;union of both rules.&quot;,
&quot;rule&quot; : &quot;whois_info.home_country != 'US' &amp;&amp; IN_SUBNET( if IS_IP(ip_src_addr) then ip_src_addr else NULL, '192.168.0.0/21')&quot;,
&quot;score&quot; : 50.0
} ],
&quot;aggregator&quot; : &quot;MAX&quot;,
&quot;aggregationConfig&quot; : { }
}
},
&quot;configuration&quot; : { }
}
[Stellar]&gt;&gt;&gt; # Now that we have admired it, we can remove the rules
[Stellar]&gt;&gt;&gt; squid_enrichment_config_new := THREAT_TRIAGE_REMOVE( squid_enrichment_config_new, [ SHELL_GET_EXPRESSION('non_us') , SHELL_GET_EXPRESSION('is_local') , SHELL_GET_EXPRES
SION('is_both') ] )
[Stellar]&gt;&gt;&gt; THREAT_TRIAGE_PRINT(squid_enrichment_config_new)
&#x2554;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2564;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2557;
&#x2551; Name &#x2502; Comment &#x2502; Triage Rule &#x2502; Score &#x2551;
&#x2560;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2567;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2563;
&#x2551; (empty) &#x2551;
&#x255a;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x2550;&#x255d;
[Stellar]&gt;&gt;&gt; # and push configs
[Stellar]&gt;&gt;&gt; CONFIG_PUT('ENRICHMENT', squid_enrichment_config_new, 'squid')
[Stellar]&gt;&gt;&gt; # And admire the resulting JSON that is devoid of threat triage rules.
[Stellar]&gt;&gt;&gt; CONFIG_GET('ENRICHMENT', 'squid')
{
&quot;enrichment&quot; : {
&quot;fieldMap&quot; : {
&quot;stellar&quot; : {
&quot;config&quot; : {
&quot;whois_info&quot; : &quot;ENRICHMENT_GET('whois', domain_without_subdomains, 'enrichment', 't')&quot;
}
}
},
&quot;fieldToTypeMap&quot; : { },
&quot;config&quot; : { }
},
&quot;threatIntel&quot; : {
&quot;fieldMap&quot; : {
&quot;stellar&quot; : {
&quot;config&quot; : {
&quot;is_alert&quot; : &quot;whois_info.home_country != 'US'&quot;
}
}
},
&quot;fieldToTypeMap&quot; : { },
&quot;config&quot; : { },
&quot;triageConfig&quot; : {
&quot;riskLevelRules&quot; : [ ],
&quot;aggregator&quot; : &quot;MAX&quot;,
&quot;aggregationConfig&quot; : { }
}
},
&quot;configuration&quot; : { }
}
[Stellar]&gt;&gt;&gt;
</pre></div></div></div></div>
</div>
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row span12">Copyright &copy; 2017.
All Rights Reserved.
</div>
</div>
</footer>
</body>
</html>