Complete the command to view the last 50 lines of the RabbitMQ log file.
tail -n [1] /var/log/rabbitmq/rabbitmq.logThe tail -n 50 command shows the last 50 lines of the log file, which helps to quickly check recent log entries.
Complete the command to search RabbitMQ logs for the keyword 'error'.
grep [1] /var/log/rabbitmq/rabbitmq.logThe grep 'error' command filters log lines containing the word 'error', helping to find issues quickly.
Fix the error in the command to continuously monitor RabbitMQ logs.
tail -f [1]/rabbitmq.log/etc/rabbitmq instead of logs.The RabbitMQ logs are usually stored in /var/log/rabbitmq. Using this path with tail -f allows live monitoring of the log file.
Complete the code to create a dictionary comprehension that maps queue names to their message counts from a list of tuples.
{queue: count for queue, count in queues if count [1] 0}The colon : separates keys and values in a dictionary comprehension. The condition count > 0 filters queues with messages.
Fill all three blanks to filter and map log entries with severity 'ERROR' and extract their timestamps.
[[1] for line in logs if '[2]' in line and line.startswith('[3]')]
This list comprehension extracts the timestamp (second word) from lines containing 'ERROR' and starting with the date prefix '2024-06-'.