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

specifying a match_phrase in filter_must #82

Closed
caphrim007 opened this issue Jul 16, 2021 · 5 comments
Closed

specifying a match_phrase in filter_must #82

caphrim007 opened this issue Jul 16, 2021 · 5 comments

Comments

@caphrim007
Copy link

I've been scratching my head on the correct syntax for this, and may be coming to the conclusion that its not possible given the current design of the provider, but what I'm looking to do is specify this value retrieved via the Logz API

"must": [
  {
    "match_phrase": {
      "kubernetes.container_name": {
        "query": "gremlin-logs"
      }
    }
  }
]

via terraform. When I attempt to send a map to the filter_must, it appears to want a string.

So far i've tried,

 30     filter_must = [
 31       {
 32         "kubernetes.container_name" = "gremlin-logs"
 33       }
 34     ]
 30     filter_must = [
 31       {
 32         "match_phrase" = "kubernetes.container_name = gremlin-logs"
 33       }
 34     ]
 30     filter_must = [
 31       {
 32        "match_phrase" = jsonencode({"kubernetes.container_name" = "gremlin-logs"})
 33       }
 34     ]
 30     filter_must = [
 31       {
 32         "match_phrase" = {
 33           "kubernetes.container_name" = "gremlin-logs"
 34         }
 35       }
 36     ]

and other combinations of maps and strings etc.

Is this possible?

@mirii1994
Copy link
Contributor

Hi @caphrim007 , thank you for alerting us about this issue.
It seems that you're right, we'll look into this, and will release a fix soon!

@mirii1994 mirii1994 mentioned this issue Aug 15, 2021
@mirii1994
Copy link
Contributor

@caphrim007 version 1.5.0 is out now and should fix your issue!
You can see an example of how to use it here: https://github.com/logzio/terraform-provider-logzio/blob/master/examples/alert_v2/main.tf#L31
Please let us know if this solves your issue :)

@mirii1994
Copy link
Contributor

Hi @caphrim007 did v1.5.0 fix the issue for you?

@caphrim007
Copy link
Author

@mirii1994 yes i think it has. thanks!

@mirii1994
Copy link
Contributor

@caphrim007 Awesome! So i'm closing this issue for now. Feel free to reach out if you need :)

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

No branches or pull requests

2 participants