Customer Portal

Count the Occurrence of a word in String

Comments 3

  • Avatar
    imriskal
    0
    Comment actions Permalink
    Hello Sri,

    Do you really want to do the aggregation grouping with the precision of miliseconds? Or maybe days? Or do you want to do the count per file? Which date should be in the output record in the case there is more date values? And is there always only one record with file name?

    I could make an example graph based on your input sample but I do not know whether it would be generic enough to cover all possible input files you can have. Please answer the questions above and I will try to make an example according to your answer.

    Thanks,
  • Avatar
    sridhar
    0
    Comment actions Permalink
    Hi Lubos,

    Sure I will Thanks again for your help. I tired with iif condition and also indexOf function but no luck.

    Yes I am looking for aggregation grouping with the precision of milliseconds in each file as Count not as CountDistinct .If I do countdistinct I will get 1 per each millisecond. Lets say for example below which I have given

    2014-03-23 03:02:03,135 Count of DownloadServelt is 12 and when I do it by Date i.e. 2014-03-23 it show all addup.

    If the file has multiple dates with precision of milliseconds then I should be getting records with two dates by milliseconds.

    Also if we can get the userid who is downloading the file i.e. ftfUserId: 30032389_FERLYNO@ftf.com should be great.

    Thanks for your help

    Sridhar
  • Avatar
    novakj
    0
    Comment actions Permalink
    Hi Sridhar,

    I prepared for you working example of your scenario. I used the Denormalizer component, which creates single output record from one or more input records. In this example I used date, time and message as keys for grouping.

    In the example I used your sample input data, output is stored in file with this format:
    Date|Time|Message|Count|File|User
    2014-03-23|03:02:03,135|com.gxs.bmo.ftf.servlet.DownloadServlet|11|DATC1403223921659[]HAR_TEST_FLE.TXT|30032389_FERLYNO@ftf.com

    I hope that the example will help you to solve your scenario.

Please sign in to leave a comment.