From 0e60886e0d2981b8a16057bb5522233ce088b67d Mon Sep 17 00:00:00 2001 From: Anton Medvedev Date: Mon, 25 Feb 2019 01:57:47 +0700 Subject: [PATCH] Update docs --- docs.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs.md b/docs.md index 1cfe905..72e065a 100644 --- a/docs.md +++ b/docs.md @@ -141,8 +141,6 @@ Usage: fx data.json '{...this, count: this.count+1}' save .count ``` - - ## Formatting If you need something different then JSON (for example arguments for xargs) do not return anything from reducer. @@ -173,6 +171,22 @@ By the way, fx has shortcut for `Object.keys(this)`. Previous example can be rew $ cat package.json | fx this.dependencies ? ``` +## Streaming mode + +`fx` supports line-delimited JSON and concatenated JSON streaming. + +```bash +$ kubectl logs ... | fx .message +``` + +Sometimes it is necessary to omit some messages in JSON stream, or select only specified log messages. +For this purpose, `fx` has special helper `select`, pass function into it to select only some JSON messages. + +```bash +$ kubectl logs ... | fx 'select(x => x.message.length > 40)' .message +``` + + ## Interactive mode Click on fields to expand or collapse JSON tree, use mouse wheel to scroll view.