this syntax give the network info on sa1 file
sar -n DEV -f /var/log/sa/sa1
how to get the info only from UDP protocol ?
we try also
sar -n UDP -f /var/log/sa/sa1
Requested activities not available in file /var/log/sa/sa1
With the UDP keyword, statistics about UDPv4 network traffic are reported. Note that UDPv4 statistics depend on sadc option "-S SNMP" to be collected. So your command is not showing stats mean stats are not enabled yet, Check if option enabled or not. Not sure which stats you are looking for in UDP one example is given below.
$ sar -n SOCK
Linux XXXXXXXXXXXXXXX.x86_64 (Myserver) 07/23/2019 _x86_64_ (2 CPU)
12:00:02 AM totsck tcpsck udpsck rawsck ip-frag tcp-tw
12:10:01 AM 282 124 8 1 0 589
12:20:01 AM 288 124 8 1 0 586
12:30:01 AM 291 129 8 1 0 374
12:40:01 AM 296 128 13 1 0 407
12:50:02 AM 301 136 8 1 0 484
01:00:01 AM 292 129 8 0 0 602
01:10:01 AM 304 132 8 1 0 487
01:20:01 AM 294 130 8 1 0 572
01:30:01 AM 293 133 8 1 0 449
01:40:01 AM 293 129 10 1 0 433
01:50:01 AM 308 135 8 1 0 341
02:00:02 AM 303 138 8 0 0 463
02:10:01 AM 305 139 8 1 0 480
02:20:02 AM 306 140 8 1 0 589
02:30:01 AM 300 142 8 1 0 584
02:40:01 AM 306 141 8 1 0 453
02:50:01 AM 309 149 8 1 0 449
03:00:01 AM 316 141 8 1 0 621
03:10:02 AM 288 123 9 1 0 552
03:20:01 AM 287 123 8 1 0 434
03:30:01 AM 293 127 8 1 0 573
03:40:02 AM 296 130 12 1 0 584
03:50:01 AM 314 141 8 1 0 391
Average: 298 133 9 1 0 500