LoginSignup
0
0

More than 1 year has passed since last update.

【1行野郎】Elasticsearch レスポンスの「green」「yellow」「red」を色付けする

Last updated at Posted at 2021-08-11

概要

下図左を右のように色付けして表示する

色付けなし 色付けあり
image.png image.png

 

コード ... decoac

image.png

使い方

## 書式は「decoac コマンド 引数」である
$ decoac curl -s -XGET 'http://localhost:29200/_cat/indices?v'

説明

単に green, yellow, red に AnsiColor コードを付与しているだけである.
(わざわざ Python のサードパーティパッケージに頼るのも面倒なくらい小さな処理である)

上図中の ^[ は制御文字である.
Vim であれば Ctrl-v → Esc、Emacs であれば Ctrl-q → Esc で入力できる.

疑問

脱線するけれども、VScode の Vim プラグインの場合はどうやって制御文字を入力するのだろうか...

 

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0