Skip to content

Commit

Permalink
Merge pull request #18 from sastred/master
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
gabrielperezs authored Feb 8, 2024
2 parents 60c2945 + 07a3587 commit cf8d017
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ Substitutions in args entry in the config file
- `CreationTimestampMilliseconds` is the message creation time with in milliseconds
- `CreationTimestampSeconds` is the message creation time in seconds _See [examples/ARRAY.md](examples/ARRAY.md) for an example_

- `$..`

If you want to select the full message you should use `$..` instead of `$.`.

- `$.Message`

If the message has a field `"Message"`, the content of the original message will be replaced with the content of the field `$.Message`.

- Indented json

[The library used to parse jq like expressions](https://github.com/savaki/jq) sometimes has problems with new lines. It is better to use json messages without new lines or other indentations.

Log outputs to stdout or firehose
----------------------------------

Expand Down Expand Up @@ -148,7 +160,8 @@ Please __put attention__ in the "cond" parameter (is a condition, like an "if").


```toml
logfile = "/var/log/goreactor.log"
[logstream]
logstream = "stdout"

[[reactor]]
concurrent = 10
Expand All @@ -164,7 +177,6 @@ cond = [
]
cmd = "/usr/local/bin/do-something-with-the-instance"
args = ["asg=$.AutoScalingGroupName", "instance_id=$.EC2InstanceId"]
argsjson = true
workingDirectory = "/path/to/process/wd/"
```

Expand Down
6 changes: 3 additions & 3 deletions examples/ARRAY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Configuration in go reactor
In the goreactor, we are ready to listen to messages and execute the command.

```toml
logfile = "/var/log/goreactor.log"
[logstream]
logstream = "stdout"

[[reactor]]
concurrent = 10
Expand All @@ -30,7 +31,6 @@ region = "eu-west-1"
output = "cmd"
cmd = "/usr/local/bin/do-something-for-that-time"
args = ["--example-argument-before", "$.args...", "--example-argument-after", "--other-timestamp=${CreationTimestampSeconds}"]
argsjson = true
```


Expand All @@ -42,4 +42,4 @@ The daemon will execute a command like
```
Note that ${CreationTimestampSeconds} from the message was overridden with 1591877960,
that's the time when the message was created in the queue.
Same thing with --other-timestamp=1591877960.
Same thing with --other-timestamp=1591877960.

0 comments on commit cf8d017

Please sign in to comment.