Skip to content

Bug: Flowpipe not able to interpret ::timestamp on query steps #516

Closed
@oaulicino

Description

While testing flowpipe, I used the following pipeline configuration:

pipeline "my_pipeline" {

  step "query" "inspector_open_findings" {
    connection_string = "postgres://steampipe@localhost:9193/steampipe"
    sql = <<-EOQ
      select
        finding_account_id,
        severity,
        exploit_available,
        fix_available,
        type,
        first_observed_at,
        last_observed_at,
        description
      from
        aws_inspector2_finding 
      where 
        status != 'CLOSED' and
        fix_available = 'YES' and
        first_observed_at::timestamp >= now()::timestamp - interval '1 day'
      order by case  
        when severity = 'CRITICAL' then 1
        when severity = 'HIGH' then 2
        when severity = 'MEDIUM' then 3
        when severity = 'LOW' then 4
        when severity = 'INFORMATIONAL' then 5
        else 6 end;
    EOQ
  }
  output "inspector_output" {
    value = step.query.inspector_open_findings.rows
  } 

Even though the query works well in steampipe, the same does not happen in flowpipe. I got the following error:

[my_pipeline] Internal Error: Bad Request: Query input must define args if the sql has placeholders
[my_pipeline] Failed 11ms

I troubleshooted the issue by removing the ::timestamp from the code and it worked (even though the result was empty. I know the pipeline configuration is correct, as I was able to remove the whole where block and I was able to see the output normally:
image

PS: I also tried the net_http_request plugin in queries and the same applies, I believe it is related to the request_headers that may not be interpreted properly, but I can't be sure in this case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions