@@ -90,11 +90,8 @@ shui \
9090 --display 3 \
9191 --labels " NVME Used Space" \
9292 --query ' df -h | grep nvme0n1p2 | awk ' \' ' {print $3}' \' ' '
93- ```
94-
95- You can also execute Shui from standard input, which works like query mode.
9693
97- ``` sh
94+ # You can also execute Shui from standard input, which works like query mode.
9895while true ; do uptime; sleep 1; done | shui
9996```
10097
@@ -113,7 +110,21 @@ See [example/shui.toml](example/shui.toml) for an example.
113110> NOTE: Most options may be mixed, but queries and expressions may only be supplied with either
114111> flags or configuration and not both.
115112
116- ### Persistence
113+ ### Manipulating Results
114+
115+ There are ways to play with the results of queries.
116+
117+ - ** Labels** are ways to name a stream of data. Query outputs are expected to be space delimited
118+ information, like a log. Labels allow keyword indexing of these results, creating an untyped
119+ schema. By default, information will be labelled with rumerically indexed.
120+
121+ - ** Filters** allow output to be selected for specific labels. This is necessary for some display
122+ modes.
123+
124+ - ** Expressions** allow transformation of results based on a expression statement. This is
125+ [ explained more below] ( #expressions ) .
126+
127+ ### Presisting Results
117128
118129Shui, by default, will store results and load them when re-executing the same query.
119130
@@ -143,11 +154,11 @@ Some examples:
143154``` sh
144155# Multiply the 5m CPU average by 10. Note that we invoke `get` with a key of `"9"` because default
145156# labels are string indexes and no labels were provided.
146- shui --query ' uptime | tr -d ","' -expr ' get(result, "9") * 10'
157+ shui --query ' uptime | tr -d ","' -- expr ' get(result, "9") * 10'
147158
148159# Cumulatively sum 5m CPU average. Note that we need to account for prevResult being empty and we
149160# must convert the prevResult from a string to a float.
150- shui --query ' uptime | tr -d ","' -filters 9 -expr ' get(result, "0") + ("0" in prevResult? float(get(prevResult, "0")) : 0)'
161+ shui --query ' uptime | tr -d ","' -- filters 9 -expr ' get(result, "0") + ("0" in prevResult? float(get(prevResult, "0")) : 0)'
151162```
152163
153164See: < https://expr-lang.org/docs/language-definition >
@@ -165,8 +176,8 @@ Shui can create Elasticsearch documents from results.
165176shui \
166177 --elasticsearch-addr < addr> \
167178 --elasticsearch-index < index> \
168- --elasticsearch-user < user > \
169- --elasticsearch-password < password
179+ --elasticsearch-password < password \
180+ --elasticsearch-user < user >
170181```
171182
172183- Documents are structured according to result labels supplied with ` --labels ` , prefixed with
0 commit comments