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

feature request: support elasticsearch search json API query #539

Open
jordo1138 opened this issue Dec 16, 2018 · 5 comments
Open

feature request: support elasticsearch search json API query #539

jordo1138 opened this issue Dec 16, 2018 · 5 comments

Comments

@jordo1138
Copy link

would be fantastic to have a native flux option to query the http api

@nathanielc
Copy link
Contributor

@jordo1138 Can you give a fake Flux example of what you are thinking?

@jordo1138
Copy link
Author

jordo1138 commented Dec 18, 2018

@nathanielc sure, so from what I gather from the blogs and influxdays talks, influxdb will let you have running tasks that are "kapacitor" like "tasks" and it would be interesting for me to use flux to write
something like below, not exactly sure if its the right way but taking the simple style of the sample flux query to using @cpu.usage_user like lucene does for indexed fields/ tags etc in elasticsearch directly and then we could take action on the results like in kapacitor, so it would be querying just for the purpose of a running task, not to store necessarily from ES to influx or anything, just centralizes the running task part so that we could then do notifications etc and other triggered output that eventually flux will have
Definitely will spend more time on flux as I haven't had a chance to yet, but will in the new year.

from(db:"telegraf")
|> filter(fn:(r) => r._measurement == "cpu" and r._field == "usage_user" and r.cpu == "cpu3")
|> range(start:-1h)

TO:
from(db:"elasticsearch") . //define this somewhere like es client for golang/python does
|> filter(fn:(r) => r._measurement == "@_cpu" and r._field == "@cpu.usage_user" and r.cpu == "@_cpu3")
|> range(start:-1h)

@nathanielc
Copy link
Contributor

@jordo1138 Thanks for the details. This helps me understand what you are after.

A elasticsearch source makes lots of sense for Flux's goals. We are working to making writing and more importantly testing new sources easier. Once we have some of those things in place I can add some more details to this issue for what it would take to be able to query elasticsearch data from Flux. But the basic idea is that a new input needs to be added to functions/inputs that can make an elastic search query using client libs.

@jordo1138
Copy link
Author

@nathanielc cool I hadn't read enough on flux yet to understand how client libs were going to be handled but I'll dive in deeper on functions/inputs
Thanks!

Copy link

github-actions bot commented Oct 4, 2024

This issue has had no recent activity and will be closed soon.

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

No branches or pull requests

2 participants