Linux cheatsheet

Sorting MinIO objects

mc find --older-than 0 --larger 10000 --json s3

Sorting with jq

mc ls -r --json s3/ | jq --slurp 'sort_by(.lastModified) | .[] | select(.key | contains("filenamepart"))'

debug

kubectl debug -it --image=ubuntu:latest -n my-ns pod/mypod --target=my-cont --profile=sysadmin -- /bin/bash

AWS log insight - Find size of log stream in log group

fields @logStream, @message
| stats count() as logEventCount, sum(strlen(@message))/1048576 as totalSizeKiloBytes by @logStream

AWS log insight - Find size per useragent

fields @timestamp, userAgent
| stats count(*) as log_count by userAgent
| sort log_count desc