@rl_dane

Fortunately, OpenBSD also makes it fairly easy to drop a ktrace(1) on a command and then dump what it's doing:

$ ktrace -f pkg_info.ktrace -d pkg_info -Q remind

$ kdump -R -f pkg_info.ktrace | less

A little #awk on that might highlight expensive steps

$ kdump -R -f pkg_info.ktrace | awk '$1+0 > 0 && $4 == toupper($4) && $3 > 0.05 && NR>1'

(adjust the "0.05" until the result-count returns interesting-but-not-too-much data)

First awk gotcha: the split function creates an array indexed from 1, rather than 0.

Also if you print an array index that doesn't exist, you just get an empty string, rather than a warning or error.

#awk

This afternoon's challenge: seeing if I can write an awk script to parse Apache log files and split them into YYYY-MM.log files so I can create per-month HTML stats using GoAccess (which doesn't support filtering input natively so I have to pre-filter).

Bit fiddly as Apache uses three character months instead of two digits, and doesn't use the same delimiter for all fields.

#awk

To procrastinate from my actual job I'm writing an awk script to show how many fewer commits get made on Thursday

#awk #datascienceiguess?

How Sysadmins Use AWK for Log Analysis

AWK remains one of the most powerful Linux tools for processing and analyzing log files.

Learn practical examples for:
• Finding 404 errors
• Counting requests
• Identifying top URLs
• Filtering logs
• Monitoring server activity

Read:
https://www.linuxteck.com/how-sysadmins-use-awk-for-log-analysis/

#linuxteck #Linux #AWK #SysAdmin #DevOps #OpenSource

How Sysadmins Use AWK For Log Analysis (Part 29 / 34) | LinuxTeck

Learn how sysadmins use AWK for log analysis in Linux. Extract fields, filter patterns, count errors, and automate log checks with real-world awk examples.

LinuxTeck

Advanced AWK can replace a surprising amount of shell scripting.

This guide covers associative arrays, CSV parsing, log analysis, aggregation, conditional filters, reporting, and performance tips with practical Linux examples.

Read:
https://www.linuxteck.com/advanced-awk-text-processing/

#linuxteck #Linux #AWK #DevOps #SysAdmin #OpenSource

10 Practical Advanced AWK Text Processing Examples In Linux

Learn advanced AWK text processing with 10 real-world examples. Master field separators, associative arrays, arithmetic, and log analysis using AWK in Linux.

LinuxTeck

AWK is one of those Linux tools many people avoid for years - until they discover how much time it saves.

Learn how to extract columns, filter records, process logs, and work with structured text using practical examples.

https://www.linuxteck.com/awk-command-in-linux/

#Linux #AWK #ShellScripting #LinuxTeck #OpenSource #DevOps #SysAdmin

AWK Command In Linux: 7 Practical Examples That Actually Work

Learn the awk command in Linux with real examples. From field printing to log parsing and automation, this practical guide covers beginner to intermediate usage.

LinuxTeck

🚨 NEWS: Comandi Linux essenziali: grep, awk, sed, find, xargs e pipe — Guida operativa

Ecco i punti chiave in breve:
💡 Se hai un server Linux, prima o poi ti trovi con un log da setacciare: centinaia di righe di testo, un errore nascosto, un IP da bloccare. Apri il file, premi Ctrl+F, scorri… e perdi...

🚀 LINK: https://meteoraweb.com/analisi-dei-dati-e-metriche/comandi-linux-essenziali-grep-awk-sed-find-xargs-e-pipe-guida-operativa

#automazione #shellScripting #grep #find #awk

How does one go about proposing errata for RFCs? While dumb, RFC1436¹ under "Full-Text Search Transaction" is missing "S: Accepts connection" which the other sample transactions have.

(I'm also not sure why the case differs, where tha client will "Open Connection" (uppercase C) but the server will "Accept [Cc]onnection" (case varies in RFC) which seems like a minor inconsistency)

And no, I am totally not playing with writing my gopherspace game server in #awk. Really. Okay, maybe exploring the idea just a bit…


¹ https://datatracker.ietf.org/doc/html/rfc1436

RFC 1436: The Internet Gopher Protocol (a distributed document search and retrieval protocol)

This document describes the protocol, lists some of the implementations currently available, and has an overview of how to implement new client and server applications. This memo provides information for the Internet community. It does not specify an Internet standard.

IETF Datatracker

@gumnos

Whoa, that's some #awk alphabet soup.

I'm gonna need to learn awk next, ain't I? XD

I actually started out doing it all in grep (pipe the words in the file to grep -vixfF /usr/share/dict/words, but it was actually twice as fast to do a positive grep per input word than one big negative grep.

I'm actually already removing duplicates via an awk command that I copypastad from the internet, but I'll play with your example, thanks! :D