21 Nov 2023 03:41 PM - last edited on 22 Nov 2023 09:55 AM by MaciejNeumann
I have a log ingested in Grails where I would like to count the number of entries of each user. The user name is the second column.
User names are dynamic, I mean new users could appear daily.
USER user1 20231121 12:11:27 95959595 12345
USER user1 20231121 12:11:29 95959595 12345
USER user5 20231121 12:11:31 95959595 12345
USER user8 20231121 12:11:33 95959595 12345
USER user1 20231121 12:11:35 95959595 12345
USER user5 20231121 12:11:37 95959595 12345
For this example, I would like to have something like this:
user1: 3
user5: 2
user8:1
Is it possible to do that?
Solved! Go to Solution.
21 Nov 2023 04:49 PM
Yes, you can use Dynatrace patterm language: https://docs.dynatrace.com/docs/platform/grail/dynatrace-pattern-language
22 Nov 2023 07:04 AM
Hi @Raul_CL ,
This would be a query for parsing and summarizing such input:
data record(content = "USER user1 20231121 12:11:27 95959595 12345"),
record(content = "USER user1 20231121 12:11:29 95959595 12345"),
record(content = "USER user5 20231121 12:11:31 95959595 12345"),
record(content = "USER user8 20231121 12:11:33 95959595 12345"),
record(content = "USER user1 20231121 12:11:35 95959595 12345"),
record(content = "USER user5 20231121 12:11:37 95959595 12345")
| parse content, "'USER ' word:user"
| summarize count(), by:user
22 Nov 2023 01:47 PM
Thank you both very much for responding. The solution proposed by stefan_eggersto worked perfectly for me.