node-journalctl icon indicating copy to clipboard operation
node-journalctl copied to clipboard

Some examples needed for opts

Open yafp opened this issue 5 years ago • 1 comments

Hi,

i would like to play with the opts

  • since
  • lines
  • filter
  • etc

but am unsure how to use them. The readme is not really helpful at that point. For example

const journalctl = new Journalctl('since=yesterday')

or

const journalctl = new Journalctl('--since=yesterday')

is not working. It feels like guessing that this point to me. In case you could explain them i can offer to make a pull request to add those details to the readme to avoid such questions in the future ;)

Bonus question:

is there an equivalent to -b aka --boot?

yafp avatar Mar 24 '20 13:03 yafp

I recently had to push ssh logs to a server so I had to figure this out a bit. This isn't really all that much help I guess but I hope it's something to get you started. I guess it's worth it to look in the code of the module to see what options can be in the object argument to create a new Journalctl instance

const Journalctl = require('journalctl');
const journalctl = new Journalctl({unit:"sshd"});

journalctl.on('event', (event) => {
  console.error(event)
});

meshstyles avatar Jan 25 '21 21:01 meshstyles