https://slingdata.io logo
Not sure if this is a bug, but when i
# sling-help
m
Not sure if this is a bug, but when i have a hook defined as part of defaults and then use a wildcard to define a stream, it doesnt execute the pre or post hook. However in the same file, if i use the exact table name, it works
here is an example replication file:
Copy code
# DB Migration Test Configuration
# Test pipeline for validating DB migration process
source: DB_PROD_REPLICA
target: DB_LOCAL

env:
  SLING_ALLOW_EMPTY: true
  SLING_THREADS: 1
  SLING_SHOW_PROGRESS: true
  SLING_DIRECT_INSERT: true

defaults:
  mode: truncate
  object: "db.{stream_table}"
  #disabled: true

  hooks:
    pre:
      - type: log
        message: "PRELOG: run.stream.schema: {run.stream.schema}"
        level: warn                    # Optional: Log level (info/warn/debug)
        on_failure: abort              # Optional: abort/warn/quiet/skip

      - type: command
        id: load_schema_totarget
        print: true
        command: |
          set -xu
          echo testing-command {run.stream.schema} 
        on_failure: abort

    post:
      - type: log
        message: "POSTLOG: run.stream.schema: {run.stream.schema}"
        level: warn                    # Optional: Log level (info/warn/debug)
        on_failure: abort              # Optional: abort/warn/quiet/skip


hooks:
  start:
    - type: command
      id: create_outputdir
      print: true
      command: |
        mkdir -p ${SLING_HOME_DIR}/output
        cd ${SLING_HOME_DIR}/output

  end:
    - type: log
      message: "Ending log message"  # Required: The message to log
      level: info                    # Optional: Log level (info/warn/debug)
      on_failure: abort              # Optional: abort/warn/quiet/skip



streams:
  db.cmty_topics_*:
    source_options:
      limit: 1

  db.cmty_topics_track:
    source_options:
      limit: 1




  db.aops_login_log:
    source_options:
      limit: 1
    columns:
      login_atom: varbinary(32)
here is an example log output
f
@mitty18 bug confirmed, fixed for next CLI release. Thanks for reporting