Splunk Search

How to perform search only using PhoneNum?

hkchew
New Member

I have 2 sourcetypes:
Eg. sourcetypeA has fields such as ServiceProvider, GroupID, DeviceUsed, DeviceSerialNum
sourcetypeB has fields such as Name, GroupID, PhoneNum, VAS1, VAS2

When I search using PhoneNum ONLY, the result needs to display PhoneNum, GroupID, DeviceUsed, DeviceSerialNum

Tags (1)
0 Karma

hkchew
New Member

Thank you guys but none of the above works.
The field name of the groupid is different in both sourcetype although groupdid is found in the field#2 of both sourcetype

0 Karma

hkchew
New Member

Thank you, guys but none of the above works.
The field name of GroupID of sourcetypeA is different from sourcetypeB although both GroupID are found on field#2 in both sourcetype.

0 Karma

somesoni2
Revered Legend

Try like this

(sourcetype=sourcetypeA) OR (sourcetype=sourcetypeB PhoneNum="YourSearchedPhoneNumHere")
| fields GroupID, DeviceUsed, DeviceSerialNum PhoneNum
| stats values(PhoneNum) as PhoneNum values(DeviceUsed) as DeviceUsed values(DeviceSerialNum) as DeviceSerialNum by GroupID
| where isnotnull(PhoneNum)
0 Karma

sbbadri
Motivator

@hkchew

try this
sourcetype=sourcetypeA | fields ServiceProvider, GroupID, DeviceUsed, DeviceSerialNum | join GroupID [ search sourcetype=sourcetypeB | fields PhoneNum, VAS1, VAS2 ] | search PhoneNum=* | table PhoneNum, GroupID, DeviceUsed, DeviceSerialNum

i hope this helps

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 ...