Skip to content

Instantly share code, notes, and snippets.

View Punkrex's full-sized avatar

Andrew Punkrex

View GitHub Profile
@Punkrex
Punkrex / dump_yarn_logs.sh
Last active June 2, 2022 12:17
Short script to dump all Yarn logs to a local directory.
#!/bin/sh
LOCAL_DIR=yarn_logs
mkdir $LOCAL_DIR
for row in $( yarn application -appStates ALL -list | awk '/application_/{print $1 "," $2}' )
do
fields=($(echo $row | tr "," "\n"))
yarn logs -applicationId ${fields[0]} > $LOCAL_DIR/${fields[0]}_${fields[1]}.log