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

Error when executing data.elasticsearch data provider #208

Closed
traut opened this issue Jun 18, 2024 · 1 comment
Closed

Error when executing data.elasticsearch data provider #208

traut opened this issue Jun 18, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@traut
Copy link
Member

traut commented Jun 18, 2024

Description

Error when trying to fetch data using elasticsearch data provider

Environment

Fabric version: v0.4.2-rc3
Plugin version: elastic, v0.4.2-rc3
Operating System: macOS

Steps to Reproduce

For the template

config data elasticsearch {
   cloud_id = "CLOUD-ID"
   api_key_str = "STR"
}

document "simple_alerts_overview" {
  data elasticsearch "alerts" {
    index = ".alerts-security.alerts-default"
    query_string = "@timestamp:[now-7d TO now]"
    size = 10000
  }
}

data command fails:

$ fabric data document.simple_alerts_overview.data.elasticsearch.alerts
Jun 18 13:47:18.265 INF Parsing fabric files command=data
Jun 18 13:47:18.275 INF Loading plugin resolver command=data includeRemote=false
Jun 18 13:47:18.276 INF Loading plugin runner command=data
Jun 18 13:47:18.310 INF Loading plugin command=data component=runner name=blackstork/elastic path=.fabric/plugins/blackstork/elastic@0.4.2-rc3
Jun 18 13:47:18.320 INF Loading plugin command=data component=runner name=blackstork/openai path=.fabric/plugins/blackstork/openai@0.4.2-rc3
Jun 18 13:47:18.328 INF Fetching data command=data target=document.simple_alerts_overview.data.elasticsearch.alerts
Jun 18 13:47:18.328 INF Loading document data command=data document=simple_alerts_overview datasource=elasticsearch name=alerts
Error: Failed to fetch data

rpc error: code = InvalidArgument desc = failed to decode config: unsupported cty type: string

$ fabric data document.simple_alerts_overview.data.elasticsearch.alerts --verbose
...
[13:47:31] @@@ github.com/blackstork-io/fabric/engine/engine.go:287
 INFO  Loading document data
  document  : simple_alerts_overview
  datasource: elasticsearch
  name      : alerts
  command   : data
[13:47:31] @@@ github.com/blackstork-io/fabric/plugin/logging.go:81
 DEBUG  Executing datasource
G params   : ============
    plugin    : blackstork/elastic
    datasource: elasticsearch
  G config    : ============
    ! base_url           : <nil>
    * cloud_id           : CLOUD-ID
      api_key_str        : <secret>
    ! api_key            : <nil>
    ! basic_auth_username: <nil>
    ! basic_auth_password: <nil>
    ! bearer_auth        : <nil>
    ! ca_certs           : <nil>
  G args      : ============
      index       : .alerts-security.alerts-default
    ! id          : <nil>
      query_string: @timestamp:[now-7d TO now]
    ! query       : <nil>
    ! aggs        : <nil>
    ! only_hits   : <nil>
    ! fields      : <nil>
    # size        : 10000
  component: plugin
  component: runner
  command  : data
[13:47:31] @@@ github.com/blackstork-io/fabric/plugin/pluginapi/v1/plugin.go:127
 DEBUG  Calling data source
  name     : elasticsearch
  component: runner
  command  : data
[13:47:31] @@@ github.com/blackstork-io/fabric/plugin/pluginapi/v1/plugin.go:129
 DEBUG  Called data source
  name     : elasticsearch
@ took     : 345.708µs
  component: runner
  command  : data
Error: Failed to fetch data

rpc error: code = InvalidArgument desc = failed to decode config: unsupported cty type: string
@traut traut added the bug Something isn't working label Jun 18, 2024
@traut traut added this to the v0.4 milestone Jun 18, 2024
@traut
Copy link
Member Author

traut commented Jun 18, 2024

fixed in #209

@traut traut closed this as completed Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant