0
0
RabbitMQdevops~10 mins

Log analysis and troubleshooting in RabbitMQ - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to view the last 50 lines of the RabbitMQ log file.

RabbitMQ
tail -n [1] /var/log/rabbitmq/rabbitmq.log
Drag options to blanks, or click blank then click option'
A50
B100
C10
D500
Attempts:
3 left
💡 Hint
Common Mistakes
Using too many lines which makes it hard to find recent errors.
Using too few lines and missing important log entries.
2fill in blank
medium

Complete the command to search RabbitMQ logs for the keyword 'error'.

RabbitMQ
grep [1] /var/log/rabbitmq/rabbitmq.log
Drag options to blanks, or click blank then click option'
A'warning'
B'info'
C'error'
D'debug'
Attempts:
3 left
💡 Hint
Common Mistakes
Searching for 'info' or 'debug' which show normal operation messages.
Forgetting to use quotes around the keyword.
3fill in blank
hard

Fix the error in the command to continuously monitor RabbitMQ logs.

RabbitMQ
tail -f [1]/rabbitmq.log
Drag options to blanks, or click blank then click option'
A/var/log
B/var/log/rabbitmq
C/etc/rabbitmq
D/usr/local/rabbitmq
Attempts:
3 left
💡 Hint
Common Mistakes
Using the config directory /etc/rabbitmq instead of logs.
Using a wrong or non-existent directory.
4fill in blank
hard

Complete the code to create a dictionary comprehension that maps queue names to their message counts from a list of tuples.

RabbitMQ
{queue: count for queue, count in queues if count [1] 0}
Drag options to blanks, or click blank then click option'
A:
B>
C<
D=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of ':' in dictionary comprehension.
Using '<' instead of '>' which filters wrong queues.
5fill in blank
hard

Fill all three blanks to filter and map log entries with severity 'ERROR' and extract their timestamps.

RabbitMQ
[[1] for line in logs if '[2]' in line and line.startswith('[3]')]
Drag options to blanks, or click blank then click option'
Aline.split()[1]
BERROR
C2024-06-
DINFO
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'INFO' instead of 'ERROR' to filter logs.
Extracting wrong part of the line for timestamp.