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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...