Created
November 4, 2019 06:02
-
-
Save and1truong/d1e4515ea5ec44abe6670c053575a96f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input: | |
http_server: | |
address: "localhost:14195" | |
path: /ping | |
pipeline: | |
processors: | |
- metadata: { key: "cursor", operator: "set", value: "" } | |
- while: | |
at_least_once: true | |
condition: | |
not: | |
metadata: { key: "cursor", operator: equals_cs, arg: "" } | |
processors: | |
- metadata: { key: "url", operator: "set", value: "https://slack.com/api/conversations.history?token=${!json_field:token}&channel=${!json_field:channel}&inclusive=1&limit=${!json_field:limit}" } | |
- log: { level: INFO, message: "cursor (before): ${!metadata:cursor}" } | |
- log: { level: INFO, message: "${!metadata:url}" } | |
- process_map: | |
processors: | |
- text: { operator: set, value: "" } | |
- http: { request: { verb: GET, url: "${!metadata:url}" } } | |
postmap: | |
messages: messages | |
nextCursor: response_metadata.next_cursor | |
- metadata: { key: "cursor", operator: "set", value: "${!json_field:nextCursor}" } | |
- log: { level: INFO, message: "cursor (after): ${!metadata:cursor}" } | |
output: | |
stdout: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment