nickwallen commented on a change in pull request #1304: METRON-1938 Add Parser 
Debugger to READMEs
URL: https://github.com/apache/metron/pull/1304#discussion_r242542144
 
 

 ##########
 File path: metron-platform/metron-management/README.md
 ##########
 @@ -150,43 +149,183 @@ The functions are split roughly into a few sections:
 
 ### Parser Functions
 
-* `PARSER_STELLAR_TRANSFORM_ADD`
+#### `PARSER_CONFIG`
+  * Description: Returns the configuration of the parser.
+  * Input:
+    * parser - The parser created with PARSER_INIT.
+  * Returns: The parser configuration.
+
+##### Example
+
+  1. Initialize the parser. The parser configuration for the sensor 'bro' will 
be loaded automatically from Zookeeper.
+      ```
+      [Stellar]>>> parser := PARSER_INIT("bro")
+      Parser{0 successful, 0 error(s)}
+      ```
+
+  1. Review the parser configuration for the 'bro' sensor.
+      ```
+      [Stellar]>>> PARSER_CONFIG(parser)
+      {
+           "parserClassName":"org.apache.metron.parsers.bro.BasicBroParser",
+           "filterClassName":"org.apache.metron.parsers.filters.StellarFilter",
+           "sensorTopic":"bro"
+      }
+      ```
+
+#### `PARSER_INIT`
+    * Initialize a parser to parse the raw telemetry produced by a sensor.
+    * Input:
+      * sensorType - The type of sensor to parse.
+      * config - [Optional] The parser configuration. If not provided, the 
configuration will be retrieved from Zookeeper.
+    * Returns: A parser that can be used to parse sensor telemetry with 
`PARSER_PARSE`.
+
+##### Example
+
+  1. Initialize a parser.  The parser configuration for the sensor 'bro' will 
be loaded automatically from Zookeeper.
+      ```
+      [Stellar]>>> parser := PARSER_INIT("bro")
+      Parser{0 successful, 0 error(s)}
+      ```
+
+  1. The parser will track the number of successes and failures and echo that 
information.
+      ```
+      [Stellar]>>> parser
+      Parser{0 successful, 0 error(s)}
+      ```
+
+  1. Alternatively, explicitly define the parser configuration.  This can be 
useful when creating a new parser or testing changes to an existing parser.
+      ```
+      [Stellar]>>> config := SHELL_EDIT()
+      {
+           "parserClassName":"org.apache.metron.parsers.bro.BasicBroParser",
+           "filterClassName":"org.apache.metron.parsers.filters.StellarFilter",
+           "sensorTopic":"bro"
+      }
+      ```
+
+  1. Initialize the parser with the parser configuration.
+      ```
+      [Stellar]>>> parser := PARSER_INIT("bro", config)
+      Parser{0 successful, 0 error(s)}
+      ```
+
+#### `PARSER_PARSE`
+    * Parses the raw telemetry produced by a sensor.
+    * Input:
+      * parser - The parser created with PARSER_INIT.
+      * input - A telemetry message or list of messages to parse.
+    * Returns: A list of messages that resulted from parsing the input 
telemetry. If the input cannot be parsed, a message encapsulating the error is 
returned as part of that list.
 
 Review comment:
   Done thanks

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to