vertica

Hi, 

I am using the MATCH for row based pattern extraction. I have to collate the output of different patterns that are present in the log file. I followed the example given in the documentation. I have following question:

 

I have two patterns to search uniqely from table suppose "AAAB" and "BABA". I am able to use MATCH to get "AAAB" pattern, now how should I proceed to get "BABA" pattern in the same query. I tried to do seprate query for both the patterns and tried to join the output  but  I was not able to perform it. Could you please provide pointers.

 

Regards,

Jack

 

 

Comments

  • Hi 

    Please post your MATCH expression that MATCH  one pattern 

    Thanks 

  • select EquipmentNumber,EventTimeStamp,EventId,AdditionalInfo, event_name()Event_1,pattern_id() as Pattern_1,match_id() as Match_1
    from
    T1
    MATCH (
    PARTITION By EquipmentNumber
    Order by EventTimeStamp
    DEFINE
    E1 AS EventId LIKE '%AMBNM%',
    E2  As EventId LIKE '%ABNXC%' and REGEXP_LIKE(AdditionalInfo ,'.*Invalid content.*')
    PATTERN P as (E1 E1 E2 +?)
    ROWS MATCH FIRST EVENT )

  • I can get the first pattern using above query. How can I get the second pattern and merge both the results? Assuming I have one more pattern from the data with say E1E1 E1 E2 E1. I want independent count of each of these patterns and Merge the results both say the Pattern1 - (25) Times and Pattern2 - (12) times as output

  • Hi

    You should change the PATTERN part to - >

     

    PATTERN P as (E1*  E2* )

     

     

    I hope you will find it helpful

     

    Thanks 

  • Hi, 

    Thanks for the reply.

     

    If I use the pattern mentioned by you. I wont get the distinct count of both the patterns. I want to get the count of two different patterns for the query.  

     

    Thanks.

  • Hi

    I am not sure i understand  , please send output of your query based on my input and what is the one you looking for .

     

    Thank 

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.