Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in benthos plugin #2338

Closed
mittal-jatin opened this issue Jan 19, 2024 · 2 comments
Closed

Issue in benthos plugin #2338

mittal-jatin opened this issue Jan 19, 2024 · 2 comments
Labels

Comments

@mittal-jatin
Copy link

mittal-jatin commented Jan 19, 2024

I'm referring https://www.benthos.dev/blog/2019/08/20/write-a-benthos-plugin/ to create a custom processor and run locally.

pipeline:
  processors:
    - json:
        operator: copy
        path: x
        value: y
    - process_field:
        path: y
        result_type: int
        processors:
          - type: fnv_hash
    - bloblang: |
        root = this
        root.x = this.x.trim()
        root.y = "task" + ((this.y % 64) % 3).string()
    - log:
        level: INFO
        message: 'test'

When I'm just having above part, its running fine and giving results as expected but when I'm adding input as

input:
  label: "bq_input_benthos"
  gcp_bigquery_select:
    project: test-project
    table: test-dataset.test-table
    columns:
      - col1
      - col2
      - col3
    where: time BETWEEN DATETIME("2024-01-15") AND DATETIME("2024-01-25")

I'm getting below error -
line 5: unable to infer input type, candidates were: [gcp_bigquery_select]

@Jeffail
Copy link
Collaborator

Jeffail commented Jan 19, 2024

Hey @mittal-jatin, that post is pretty old and outdated, ideally you want to follow the example plugin repo: https://github.com/benthosdev/benthos-plugin-example and the examples from https://pkg.go.dev/github.com/benthosdev/benthos/[email protected]/public/service, specifically you need to import the specific plugins from the main project that you want as they aren't all included in your build by default. Take a look at the imports here: https://github.com/benthosdev/benthos-plugin-example/blob/master/main.go#L14

Closing as per #2026

@Jeffail Jeffail closed this as completed Jan 19, 2024
@mittal-jatin
Copy link
Author

Thanks, this was helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants