robinovitch61 / wander

A terminal app/TUI for HashiCorp Nomad
MIT License
433 stars 17 forks source link

Not all events displayed #92

Closed robinovitch61 closed 1 year ago

robinovitch61 commented 1 year ago

Each event from the api can return multiple events, not just one. Wander currently only displays the first one.

viniciusartur commented 1 year ago

Actually what's useful for me in the events is the Time and Display Message. Via Nomad UI you can find them in http://127.0.0.1:4646/ui/allocations/f0efaed0-e293-054f-390d-da1df7ce03a9/task-name or via CLI:

nomad alloc status -namespace='*' -json $alloc | jq ".TaskStates.\"$task\".Events[] | [.Time,.DisplayMessage] | @tsv"  -r

If I could have this information when going to the events view, that would be great, @robinovitch61

robinovitch61 commented 1 year ago

@viniciusartur see if you can't do it with a custom jq query in your ~/.wander.yaml already! Not sure if this will work for you or be complete/accurate, but something like

wander_event_jq_query: >
  .Events[] | {
      "1:Index": .Index,
      "2:Topic": .Topic,
      "3:Type": .Type,
      "4:Name": .Payload | (.Job // .Allocation // .Deployment // .Evaluation) | (.JobID // .ID),
      "5:ID": .Payload | (.Job.ID // (.Allocation // .Deployment // .Evaluation).ID[:8]),
      "6:Custom": (.Payload.Allocation.TaskStates // []) | to_entries[] | .value.Events[] | [.Time,.DisplayMessage]
  }

in that file maybe?

If you find a good query, please share it, maybe I'll change the default.