Splunk Search

What is most efficient way to join 2 broken sources?

P3P4
New Member

Hi,

I have 2 sources of data.
One contains visitor statistics similar to this format:
visitorID="154";visitorName="Bob";visitorCreated="5/6/2012"

Other one contains visitor actions similar to this format:
actionID="57798";actionVisitorID="154";actionTitle="forum comment";actionCreated="6/6/2012"

What I'm looking for is to create report with most active visitors over span of two years. Each visitor can have up to 1000 actions and there are more than 60000 visitors per day on average.

Firstly, each visitor has multiple records spanning over long period, therefore I cannot create event correlation over time.

Secondly, some records are broken. Not every action has corresponding visitor and vice versa. I would like to create report only on those records which are not broken.

I was thinking of something like this:

source=visitor [search source=action [search source=visitor | rename visitorID as actionVisitorID] | top actionVisitorID | rename actionVisitorID as visitorID]

In other words: search for actions, but limit only those which has matching visitors and get me only most active. Then project results to visitor and display most active visitor records.

Cheers

Tags (2)
0 Karma

eashwar
Communicator

you can use OR to do the job

source=visitor OR source=action | rex field=actionVisitorID "^(?P<visitorID>\d+)" | top visitorID

you can also use rename actionVisitorID AS visitorID instead of using rex.

finish your search by | top visitorID

or you can also do a transaction if you want to group the events by visitorID

| transaction visitorID

i hope now you can find the most active users beased on the eventcount or the mvcount of the data field.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...