Created
August 21, 2020 13:26
-
-
Save asbjornenge/d0e1ff64cf0629e61bb6d02f33bc1afb to your computer and use it in GitHub Desktop.
Node script to capture memlogd logs from linuxkit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net from 'net' | |
var client = net.createConnection("/var/run/memlogdq.sock") | |
client.on('connect', function() { | |
console.log('connected') | |
}) | |
client.on('data', function(data) { | |
// Stream logs to somewhere fun... | |
console.log(data.toString()) | |
}) | |
/* | |
* 0 = logDumpFollow | |
* 1 = logFollow | |
* 2 = logDump | |
*/ | |
var logparam = new Uint8Array(1) | |
logparam[0] = 1 | |
client.write(logparam) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment