Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Operating System
Use of 'log stream --predicate' to exit as soon as event is detected
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Teddos" data-source="post: 1917090" data-attributes="member: 414406"><p>Hello,</p><p></p><p>I'm trying to write a simple script that monitors starting and stopping an application. It would then send an appropriate message using MQTT on my network. For instance, to automatically turn on and off some lights using Home Assistant. The latter runs on a RPi.</p><p></p><p>The application in question is OBS and i can detect the start and stop events using the following log commands:</p><p></p><p>log stream --predicate 'composedMessage contains "com.obsproject.obs-studio" and composedMessage contains "CHECKIN"'</p><p>log stream --predicate 'composedMessage contains "Removing process: [app<application.com.obsproject.obs-studio"'</p><p></p><p>I would like the log to exit as soon as the requested event is triggered. I could then use MQTT to send an appropriate message to the broker.</p><p></p><p>Any help on how to exit logging would be much appreciated!</p><p></p><p>Ted.</p></blockquote><p></p>
[QUOTE="Teddos, post: 1917090, member: 414406"] Hello, I'm trying to write a simple script that monitors starting and stopping an application. It would then send an appropriate message using MQTT on my network. For instance, to automatically turn on and off some lights using Home Assistant. The latter runs on a RPi. The application in question is OBS and i can detect the start and stop events using the following log commands: log stream --predicate 'composedMessage contains "com.obsproject.obs-studio" and composedMessage contains "CHECKIN"' log stream --predicate 'composedMessage contains "Removing process: [app<application.com.obsproject.obs-studio"' I would like the log to exit as soon as the requested event is triggered. I could then use MQTT to send an appropriate message to the broker. Any help on how to exit logging would be much appreciated! Ted. [/QUOTE]
Verification
Post reply
Forums
Apple Computing Products:
macOS - Operating System
Use of 'log stream --predicate' to exit as soon as event is detected
Top