# Data Generation & Transformation
# Generate test data and apply transformations using the generate input
#
# Source: https://docs.expanso.io/examples/data-transformer
#
# Usage (runs locally, no account needed):
#   curl -sSLo pipeline.yaml https://docs.expanso.io/examples/data-transformer.yaml
#   expanso-edge validate pipeline.yaml
#   expanso-edge run --local --data-dir ./.edge
#
# In a second terminal, deploy the pipeline to it as a job:
#   export EXPANSO_CLI_CONFIG_DIR="$PWD/.expanso-cli"
#   { printf 'name: data-transformer\ntype: pipeline\nconfig:\n'
#     sed 's/^/  /' pipeline.yaml; } |
#     expanso-cli --endpoint http://localhost:9010 job deploy -

input:
  generate:
    interval: 5s
    mapping: |
      root.id = uuid_v4()
      root.message = "Hello from Expanso"
      root.timestamp = now()
      root.count = counter()

pipeline:
  processors:
    - mapping: |
        root = this
        root.processed_at = now()

output:
  stdout:
    codec: lines
