sqshq / sampler

Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.

Home Page:https://sampler.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

:grey_question: Layout question (jq | column) inside textboxes (deal with t ad \t)

adriens opened this issue Β· comments

commented

πŸ‘‰ Context

I'm preparing of ready to use sample dashboards. At the end i'll create a dedicated & public GH repo.

❔ Question about alignement

I would like to get the following command in a nice looking way in sampler.

Everything looks fine from the terminal :

curl -s https://hub.docker.com/v2/repositories/optnc | jq -r '"Image\tStars\tPulls", "-----------------------\t-------\t------", ( .results | sort_by(.pull_count) | reverse | .[] | "\(.name)\t\(.star_count)\t\(.pull_count)")' | column -t -s $'\t'

see below :

image

... but when I put the same commad in the following conf (inspired by code sample) :

textboxes:
  - title: OPT-NC Docker image stats
    rate-ms: 15000
    sample: curl -s https://hub.docker.com/v2/repositories/optnc | jq -r '"Image\tStars\tPulls", "-----------------------\t-------\t------", ( .results | sort_by(.pull_count) | reverse | .[] | "\(.name)\t\(.star_count)\t\(.pull_count)")' | column -t -s $'\t'

I get the following render (something weird appears with t and \t) :

image

πŸ‘‰ I guess it has to deal with special characters... but in your sample I did not see any special tricks

Any idea about what I'm doing wrong ?... or am missing in formating options ?

Thank you in advance for any help or feedback.