Skip to content
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

sensuctl event list tabular display bug #2099

Closed
jspaleta opened this issue Sep 21, 2018 · 3 comments
Closed

sensuctl event list tabular display bug #2099

jspaleta opened this issue Sep 21, 2018 · 3 comments

Comments

@jspaleta
Copy link
Contributor

Found a bug doing my Yolo demo.
Check the attached screenshot for config details.
screenshot from 2018-09-21 11-23-08

Gut tells me its something specific with my podman based check command output.
It looks like the output parsing is all garbled..maybe due to line return characters at the end of the output?

sensuctl event info frodo_baggins docs.sensu.io looks okay though
sensuctl event list --format=json also looks fine.

see attached output of sensuctl event list --format=json
event_list.txt

Expected Behavior

docs.sensu.io and docs_sensu_io checks should display correctly in event list tabular view

Current Behavior

output for these checks are garbled.

Possible Solution

Steps to Reproduce (for bugs)

Not sure how to reproduce generally.. i've only seen this with my podman based check command.
Do we have a documented way for me to inject a check result via cmdline?

Context

Your Environment

rpm package sensu-backend-2.0.0~nightly+20180920-1.x86_64
Fedora

@nikkictl
Copy link

Oh this is a fun one! Okay, I'm able to reproduce the issue! Yes, it has to do with the check output containing the return and newline characters: /r/n.

$ sensuctl event list
      Entity                 Check                     Output           Status   Silenced             Timestamp            
 ──────────────── ─────────────────────────── ──────────────────────── ──────── ────────── ─────────────────────────────── 
  frodo_baggins    always_false                                              1   false      2018-09-21 12:20:55 -0700 PDT  
        1   false      2018-09-21 12:20:33 -0700 PDT  tp WARNING: 301
                                                                                                                           
        1   false      2018-09-21 12:20:41 -0700 PDT  tp WARNING: 301
                                                                                                                           
  frodo_baggins    keepalive                                                 1   false      2018-09-21 12:22:49 -0700 PDT  
  samwise_gamgee   always_false_with_mapping                                 1   false      2018-09-14 12:21:06 -0700 PDT  
  samwise_gamgee   keepalive                                                 1   false      2018-09-21 11:59:51 -0700 PDT 

So, we could render the check output last, which solves the immediate formatting problem. However, our resources that contain timestamps typically display those as the last column.

$ sensuctl event list
      Entity                 Check             Status   Silenced             Timestamp                     Output          
 ──────────────── ─────────────────────────── ──────── ────────── ─────────────────────────────── ──────────────────────── 
  frodo_baggins    always_false                     1   false      2018-09-21 12:20:55 -0700 PDT                           
  frodo_baggins    docs.sensu.io                    1   false      2018-09-21 12:20:33 -0700 PDT   CheckHttp WARNING: 301
                                                                                                                           
  frodo_baggins    docs_sensu_io                    1   false      2018-09-21 12:20:41 -0700 PDT   CheckHttp WARNING: 301
                                                                                                                           
  frodo_baggins    keepalive                        1   false      2018-09-21 12:22:49 -0700 PDT                           
  samwise_gamgee   always_false_with_mapping        1   false      2018-09-14 12:21:06 -0700 PDT                           
  samwise_gamgee   keepalive                        1   false      2018-09-21 11:59:51 -0700 PDT                           

@annaplotkin I would love some product feedback on a direction here. I see a few different solutions.

  1. Move the Output field to the right most column (see solution above). It's simple, but not the most consistent with other resources.
  2. Sensuctl allows users to configure which special characters they want trimmed from fields, perhaps through a flag ex. --trim-special-char '/n'. Implementation might be complex unless we limit the fields that this flag can apply to. Performance deficit.
  3. We leave it up to the user to trim special characters from check output, if they so choose. We would also make a note in the documentation regarding how tabular format only explicitly expresses values.

@calebhailey
Copy link

Related: #3667

@stale
Copy link

stale bot commented Nov 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Nov 2, 2020
@stale stale bot closed this as completed Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants