-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add log-events.py script #368
Conversation
72d4fe7
to
beabdbb
Compare
log_message = log_message.replace('\\"', '"') | ||
|
||
# Extract JSON part from the log message | ||
json_part = re.search(r'{.*}', log_message).group() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should check if this return result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
json_match = re.search(r'{.*}', log_message)
if not json_match:
print("No JSON part found in log message.")
return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see comments
Signed-off-by: Jack Ding <jackding@gmail.com>
beabdbb
to
fe0fe33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aneeshkp, jzding The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[ART PR BUILD NOTIFIER] Distgit: cloud-event-proxy |
Usaeg:
oc -n cloud-events logs -f deployment/cloud-consumer-deployment -c cloud-event-consumer | python3 hack/log-events.py
Results:
PULL: events pulled by calling GET api/ocloudnotifications/v2/{resource_address}/CurrentState
⬅️ 2024-10-31T14:23:01.6652Z: event.sync.sync-status.os-clock-sync-state-change
⬅️ 2024-10-31T14:24:01.6618Z: event.sync.ptp-status.ptp-state-change
PUSH: events pushed by PTP producer
➡️ 2024-10-31T14:45:15.0756Z: event.sync.ptp-status.ptp-state-change
➡️ 2024-10-31T14:45:15.0757Z: event.sync.sync-status.synchronization-state-change