[ 
https://issues.apache.org/jira/browse/METRON-295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15630201#comment-15630201
 ] 

ASF GitHub Bot commented on METRON-295:
---------------------------------------

Github user cestella commented on a diff in the pull request:

    https://github.com/apache/incubator-metron/pull/338#discussion_r86225520
  
    --- Diff: 
metron-platform/metron-parsers/src/test/java/org/apache/metron/parsers/PythonParserTest.java
 ---
    @@ -0,0 +1,81 @@
    +package org.apache.metron.parsers;
    +
    +import java.util.HashMap;
    +import java.util.List;
    +import java.util.Map;
    +
    +import org.adrianwalker.multilinestring.Multiline;
    +
    +public class PythonParserTest extends ScriptParserTest {
    +
    +   /**
    +       {
    +       "customerId":117,
    +      "first_name":"karthik",
    +      "last_name":"narayanan",
    +      "age":"38",
    +      "login-time":"2016-01-28 15:29:48",
    +      "ip-address":"216.21.170.221",
    +      "os":"windows 10",
    +      "device":"Dell Inspiron"
    +      }
    +      */
    +     @Multiline
    +     public String result=" {"+
    +      "\"source\":\"userlog\","+
    +       "\"customerId\":117,"+
    +      "\"first_name\":\"karthik\","+
    +      "\"last_name\":\"narayanan\","+
    +      "\"age\":\"38\","+
    +      "\"login-time\":\"2016-01-28 15:29:48\","+
    +      "\"ip-address\":\"216.21.170.221\","+
    +      "\"os\":\"windows 10\","+
    +      "\"device\":\"Dell Inspiron\""+
    +      "\"original_string\":\"2016-01-28 
15:29:48|117|karthik|narayanan|38|216.21.170.221|windows 10|Dell Inspiron\""+
    +      "}";
    +     
    +   @Override
    +   public Map getTestData() {
    +           Map testData = new HashMap<String,String>();
    +       String input = "2016-01-28 
15:29:48|117|karthik|narayanan|38|216.21.170.221|windows 10|Dell Inspiron";
    +       testData.put(input,result);
    +       return testData;
    +   }
    +
    +   @Override
    +   public String getScriptPath() {
    +           // TODO Auto-generated method stub
    +           return 
"../metron-integration-test/src/main/sample/scripts/test.py";
    +   }
    +
    +   @Override
    +   public String getParseFunction() {
    +           // TODO Auto-generated method stub
    --- End diff --
    
    Remove


> Script parsing bolt 
> --------------------
>
>                 Key: METRON-295
>                 URL: https://issues.apache.org/jira/browse/METRON-295
>             Project: Metron
>          Issue Type: New Feature
>    Affects Versions: 0.2.1BETA
>            Reporter: James Sirota
>            Assignee: Karthik Narayanan
>            Priority: Minor
>              Labels: newbie, platform
>             Fix For: 0.2.2BETA
>
>
> In addition to having a Grok parsing bolt we need a bolt that can execute a 
> script in order to parse a telemetry.  This way you can still script the 
> parsing for telemetries for which Grok expressions are too complex, but still 
> don't have to define a java parser 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to