Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreben committed Jan 25, 2018
1 parent 99e9e55 commit 5591640
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ Using `-readjson`, you can tell `ts` to parse each input line as a separate JSON

```bash
$ echo '{"hello": "World"}' | ts -readjson -template "{{.TimeString}} {{.Object.hello}}"
```

```
2018-01-25T21:55:06+01:00 World
```

Expand All @@ -130,6 +133,9 @@ This allows you to use only specific fields of the object as stopwatch reset tri
```bash
$ (echo {}; sleep 1; echo {}; sleep 1; echo '{"reset": "yes"}'; echo {}) |
ts -jsontemplate "{{.reset}}" -start yes -template "{{.I}} {{.DeltaNanos}}"
```

```
0 14374
1 1005916918
2 2017292187
Expand All @@ -140,6 +146,9 @@ The output of the JSON template is stored in the field `.JSONText` of the `line`

```bash
$ echo '{"message":"hello"}' | ts -jsontemplate "{{.message}}" -template "{{.TimeString}} {{.JSONText}}"
```

```
2018-01-25T22:20:59+01:00 hello
```

Expand Down

0 comments on commit 5591640

Please sign in to comment.