Splunk Search

Extract the Data from two line of the logs

UsplunkC
New Member

I need some help to extract the data from two lines as specified above but unable to do that.
Following are the two log lines

2013-01-18 17:54:50,188 [PxtId - 699479170] [PId - (null)] [MID: 157] DEBUG CloudComputingServiceInterceptor - Operation context: PyathonxId : 699479170, ApplicationId: CComp2, UserId: 7, Id: 1

5:54:50.188 PM 2013-01-18 17:54:50,188 [PxtId - 699479170] [PId - (null)] [MID: 157] DEBUG Cloud.Computing.Service - Enter GetNewData ...

PxtID is common in both the cases and i need to find based on UserId: (variable) how many times "Enter GetNewData ..." has been called....

Something like following
UserID: 7 = 15
UserID: 2 = 10
Or
If i provide UserId in the query it provide me the logs so I can count manually.

Tags (1)
0 Karma

ytamura
Path Finder

I'm not sure if I completely understand your question, but I'm assuming that PxtId is unique to each pair? If so, you can use a transaction to group those pairs into a single event, then do a count by UserId:

your search to isolate those two types of logs | transaction PxtId | chart count by UserId

This is assuming that both PxtID and UserId have been parsed as fields. You can do a similar search using a join on PxtId.

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...