Splunk Search

Rex for extracting OS types

splgeek
Explorer

Can someone please help me extract all different OS types from my logs. is there anyway Single rex query i can write to extract all possible OStypes

I see - Windows NT, MAC OS, Linux Android 6.0, Linux Android 7.0, ,there are few more
See sample logs

"Login","XXXX","XXXXX","XXXX","XXXXX","435","66","XXXXX","/index.jsp","","","","XXXX","XXXX","Mozilla/5.0 (Linux; Android 6.0.1; SM-G900V Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/XXXXX Mobile Safari/XXX","","9998.0","","XXXX","XXXXX","2016-11-17T23:59:CSCS","XXXXX",""

--

"Login","XCCXC","XXXX-XXXX-","XXX","XXX","155","12","XXXX","/services/oauth2/token","","","","XXXX","XXXX","SalesforceMobileSDK/3.1.0 android mobile/6.0.1 (SM-G900V) Salesforce1/XXX Native","","XXXXX","","XCXc","XXX-XXX-XXX-GCM-XXX","2016-11-17ScT23:59:SCSCSc","XXX",""

----
Tags (1)
0 Karma

chimell
Motivator

Hi splgeek
The following search code give you : Linux; Android 6.0.1;

index="your index_name"|rex field=_raw "(?<myfield>[\w+\;\s+\w+\s+\.\d+]+\;)"|table myfield
0 Karma

splgeek
Explorer

thanks
so thats just for extracting linux?
is there anyway to extract them all with 1 query?

0 Karma

chimell
Motivator

Please can you extend your sample logs , for permitting me to see well your events ?

0 Karma

chimell
Motivator

i need to see well before extracting

0 Karma

richgalloway
SplunkTrust
SplunkTrust

This answer may help.

---
If this reply helps you, Karma would be appreciated.
0 Karma

splgeek
Explorer

as a refresher could you /anyone give me the spl query with rex/regex to extract these OS types with a field label name as Ostype

I cannot install any TA's for this

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...