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

Otto Fowler commented on METRON-567:
------------------------------------

: to list
Looking for some background here.  If you read the jira, the issue we have is a 
fully numeric value for a field being looked at for enrichment is causing an 
exception at enrichment time because we are using casting, and trying to cast a 
Long to a String.

We support getting the value the following ways:

public Object getValue() {
  return value;
}

public <T> T getValue(Class<T> clazz) {
  return clazz.cast(getValue());
}


In practice, we pretty much always call this with either Map.class or 
String.class.
All of the tests we have as well always use Strings.  If we want a String, 
based on CacheKey we cannot assume as we do the ability to cast to it, and 
maybe should do getValue().toString() or something.

In METRON-567 - it looks like the parser is mapping the csv input through grok 
to either strings or longs based on their composition ( I have not gone down 
the rabbit hole to the grok side of this yet to confirm where the mapping to 
object type is done ).  So that will be a problem as well. I think based on my 
current understanding that each Cache is per message operation, and we don’t 
have to worry that field _a may be Long one message and String in the next.

>From the readme.md in enrichments, there doesn’t seem to be a restriction on 
>the ‘type’ of a field in the enrichment mappings to String.

Any thoughts?


> Usernames as numerics strings attempted to be parsed and compared as numbers
> ----------------------------------------------------------------------------
>
>                 Key: METRON-567
>                 URL: https://issues.apache.org/jira/browse/METRON-567
>             Project: Metron
>          Issue Type: Bug
>    Affects Versions: 0.2.1BETA
>         Environment: Linux CentOS 6.5
> 252GB RAM
> HDP 2.5
> 16TB HDD
>            Reporter: ed de
>            Assignee: Otto Fowler
>            Priority: Minor
>         Attachments: metron-567.zip
>
>
> 1. Windows logs are being ingested through Nifi, most usernames are number 
> (ex: 423191384) 
> 2. Windows parser Grok pattern for element "usrName" has been modified to and 
> from : GREEDYDATA, NUMBER, WORD, USERNAME.
> 3. An enrichment has been flatline loaded into Hbase containing department, 
> manager, firstname, lastname, etc.
> 4. The enrichment works if the usrName is characters (ex: DONALDDUCK)
> 5. The consistent error message is "cannot cast java.lang.Long to 
> java.lang.String". This is readily apparent in the enrichment log under 
> /var/log/storm/enrichment*
> To recreate, build a parser that looks for a username, then build a simple 
> enrichment, then feed a sample of numeric and non-numeric username logs 
> through the system and see which one parses and enriches. 



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

Reply via email to