Skip to content

Commit cbdc3ce

Browse files
authored
Add files via upload
1 parent 48621a2 commit cbdc3ce

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

Windows.Networking.sql

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
-- Diagnostic Microsoft.Windows.Networking (only). Use:
2+
-- https://github.com/kacos2000/Queries/blob/master/NetworkingTriage.sql
3+
-- for a more network history.
4+
--
5+
-- Database location:
6+
-- C:\ProgramData\Microsoft\Diagnosis\EventTranscript\EventTranscript.db
7+
-- For more info visit https://github.com/rathbuna/EventTranscript.db-Research
8+
9+
SELECT
10+
11+
--Timestamp from db field
12+
json_extract(events_persisted.payload,'$.time') as 'UTC TimeStamp',
13+
-- Timestamp from json payload
14+
datetime((timestamp - 116444736000000000)/10000000, 'unixepoch','localtime') as 'Local TimeStamp',
15+
json_extract(events_persisted.payload,'$.ext.loc.tz') as 'TimeZome',
16+
json_extract(events_persisted.payload,'$.ext.utc.seq') as 'seq',
17+
18+
-- events
19+
replace(replace(replace(replace(replace(replace(full_event_name,'Microsoft.Windows.Networking.',''),'DHCP.',''),'DHCPv6.',''),'DNS.',''),'SharedAccess.',''),'NetworkSetupSvc.','') as 'Event',
20+
21+
-- DHCP
22+
json_extract(events_persisted.payload,'$.data.DhcpMode') as 'DhcpMode',
23+
case json_extract(events_persisted.payload,'$.data.GotOffer')
24+
when 0 then 'No'
25+
when 1 then 'Yes'
26+
else json_extract(events_persisted.payload,'$.data.GotOffer')
27+
end as 'GotOffer',
28+
case json_extract(events_persisted.payload,'$.data.DisableDhcpSet')
29+
when 0 then 'No'
30+
when 1 then 'Yes'
31+
end as 'DisableDhcpSet',
32+
case json_extract(events_persisted.payload,'$.data.DhcpIsInitState')
33+
when 0 then 'No'
34+
when 1 then 'Yes'
35+
else json_extract(events_persisted.payload,'$.data.DhcpIsInitState')
36+
end as 'DhcpIsInitState',
37+
38+
case json_extract(events_persisted.payload,'$.data.DhcpGlobalUseNetworkHint')
39+
when 0 then 'No'
40+
when 1 then 'Yes'
41+
end as 'DhcpGlobalUseNetworkHint',
42+
case json_extract(events_persisted.payload,'$.data.LeaseObtained')
43+
when 0 then 'No'
44+
else time(json_extract(events_persisted.payload,'$.data.LeaseObtained'),'unixepoch')
45+
end as 'LeaseObtained', -- in seconds
46+
time(json_extract(events_persisted.payload,'$.data.LeaseTime'),'unixepoch') as 'LeaseTime', -- in seconds (converted to HH:MM:SS)
47+
time(json_extract(events_persisted.payload,'$.data.LeaseDuration'),'unixepoch') as 'LeaseDuration', -- in seconds (converted to HH:MM:SS)
48+
time(json_extract(events_persisted.payload,'$.data.LeaseExpires'),'unixepoch') as 'LeaseExpires', -- in seconds (converted to HH:MM:SS)
49+
json_extract(events_persisted.payload,'$.data.NextHop') as 'NextHop', -- usually the Router IP
50+
json_extract(events_persisted.payload,'$.data.AssignedAddress') as 'AssignedAddress',
51+
json_extract(events_persisted.payload,'$.data.Dest') as 'Dest',
52+
json_extract(events_persisted.payload,'$.data.DestMask') as 'DestMask',
53+
54+
-- DNS Servers
55+
json_extract(events_persisted.payload,'$.data.DnsServers') as 'DnsServers',
56+
57+
-- InstallPnPDevice
58+
json_extract(events_persisted.payload,'$.data.driverDesc') as 'driverDesc',
59+
json_extract(events_persisted.payload,'$.data.pnpId') as 'pnpId',
60+
json_extract(events_persisted.payload,'$.data.providerName') as 'providerName',
61+
json_extract(events_persisted.payload,'$.data.mediaType') as 'mediaType',
62+
json_extract(events_persisted.payload,'$.data.physicalMediaType') as 'physicalMediaType',
63+
64+
-- Tracking
65+
json_extract(events_persisted.payload,'$.data.InterfaceGuid') as 'Interface',
66+
json_extract(events_persisted.payload,'$.data.SessionTrackingGuid') as 'Session',
67+
68+
69+
logging_binary_name
70+
71+
72+
from events_persisted
73+
-- include events:
74+
where events_persisted.full_event_name like 'Microsoft.Windows.Networking.%'
75+
-- excluse event list:
76+
and events_persisted.full_event_name not like '%DiscoveryAttempt%'
77+
and events_persisted.full_event_name not like '%MediaConnected%'
78+
and events_persisted.full_event_name not like '%SolicitAttempt%'
79+
and events_persisted.full_event_name not like '%BFE.%'
80+
and events_persisted.full_event_name not like '%WFP.%'
81+
and events_persisted.full_event_name not like '%EDP.%'
82+
and events_persisted.full_event_name not like '%AllDnsServersTimeoutStatistics%'
83+
and events_persisted.full_event_name not like '%DnsServerFailureStats%'
84+
and events_persisted.full_event_name not like '%DnsServerStatistics%'
85+
and events_persisted.full_event_name not like '%DnsQueryStats%'
86+
and events_persisted.full_event_name not like '%DhcpSetEventInRenewState%'
87+
and events_persisted.full_event_name not like '%InterfaceCapabilityChangedEvent%'
88+
-- Sort by date descending (newest first)
89+
order by events_persisted.timestamp desc

0 commit comments

Comments
 (0)