-
|
I've been playing with the idea of using Vector to try and pull log data from Fastly Signal Science solution using their API. https://docs.fastly.com/en/ngwaf/extract-your-data It seems that the HTTP Client source would be a good base for this but their API throws up some interesting issues to solve. Firstly, the responses are paginated so it would need to be aware of that and look for the next page URL given in the response and automatically fetch that, eventually getting all the pages for the full data set. So I guess the the source would be making multiple HTTP requests to the API as needed. Also the from/until timestamp - as these require UTC timestamp values they'd need to be dynamic and based on the current time that the source collection start. I was thinking about having it expressed as an negative offset from "now" in minutes. i.e from = now-10m, until = now-5m then run the source with a 5m interval. I was also thinking if now should be aligned to the nearest 5 minute to account for any delay from the desired start time and the actual time. So yeah, I don't think this is possible out-of-the box and requires modifying the default HTTP Client source but I'd love some feed back on possible approaches or gotchas. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
The sort of challenges that API has (pagination and keeping track of where to start each request) seem to fairly common across other APIs that users want to consume from Vector with. I could see enhancing the As a workaround, you could write a standalone program that reads the data and passes it to Vector over one of its existing sources (like |
Beta Was this translation helpful? Give feedback.
-
|
I'm dealing with this one again with yet another API so I want to revive this discussion I don't know what the correct general way to handle pagination is, since every API is going to be different. Okta handles it with a I think that maybe one solution is to add a For something like the Okta streaming API (just as an example. I've written the Okta source to handle this specific case) the API always returns a The issues here I guess is how to expose a state machine to VRL (what indicates that it should stop?) and the internal configuration (ie, the url that it should hit next time) |
Beta Was this translation helpful? Give feedback.
The sort of challenges that API has (pagination and keeping track of where to start each request) seem to fairly common across other APIs that users want to consume from Vector with. I could see enhancing the
http_clientsource to be able to handle this. Given the scope of the change I think we'd likely want to see an RFC for it first.As a workaround, you could write a standalone program that reads the data and passes it to Vector over one of its existing sources (like
http_server).