Splunk Search

Search for sample to convert my Pivot Table from excel to SPL, have raw data

puppy0723
New Member

Hi, 

I am a beginner of SPLUNK and SPL. 

Recently I am asked to replace my statistic table from excel  into SPLUNK to control windows server status. 

Below is my brief raw data in csv format

systemNameDepartmentosVersionpatchesDiskD_total_size_TBDiskD_free_size_TBLincense_end
HOST00001AWindows 2012 R2KB56:KB59:KB94:KB98:KB113:KB11841.81250.8310546882023/7/25
HOST00002AWindows 2016KB107KB131:KB13540.5781253.0341796882023/8/2
HOST00003XWindows 2012 R2KB56:KB59:KB94:KB98:KB11341.81250.5380859382020/10/15
HOST00004XWindows 2012 R2KB56:KB59:KB94:KB98:KB113:KB11841.812510.323242192022/12/25
HOST00005XWindows 2016KB107KB131:KB13541.81251.8037109382023/7/25
HOST00006AWindows 2019KB36:KB37:KB39:KB40:KB4140.5781252.6826171882022/12/25
HOST00007YWindows 2019KB36:KB37:KB39:KB40:KB41:KN5040.5781256.9482421882023/1/25
HOST00008YWindows 2016KB107KB131:KB13541.81250.0341796882023/1/25
HOST00009YWindows 2016KB107KB13141.81250.0341796882022/12/25
HOST00010AWindows 2016KB107KB131:KB13541.81256.6318359382019/5/17

 

And  I want to summarize the data to a table like this, the key is to judge server is deployed the target patch or not of each version.

 Windows 2012 R2Windows 2012 R2Windows 2016Windows 2016Windows 2019Windows 2019Total
Departmentnon-patchedKB118non-patchedKB135non-patchedKB41 
A0102014
X1101003
Y0011013
Total12140210

And another table to check license duration is less than one year or not.

systemNameDepartmentLincense_endLicense_life < 1 yearLicense_expired
HOST00001A2023/7/25NN
HOST00002A2023/8/2NN
HOST00003X2020/10/15YN
HOST00004X2022/12/25NN
HOST00005X2023/7/25NN
HOST00006A2022/12/25NN
HOST00007Y2023/1/25NN
HOST00008Y2023/1/25NN
HOST00009Y2022/12/25NN
HOST00010A2019/5/17YY

 

I am not familiar with SQL and SPL, could anyone provide some hint or example resouce to me , please help~

I can merely have a SPL to count total of each osVersion and Dept like this , but have no ieda to divide into patched or not and join the sub-search....

index=windows sourcetype=csv search Department In("A", "X", "Y") | stats count(osVersion) by Department patches

 

 

Labels (1)
Tags (1)
0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...