Scripted fields - curl command?


Is it possible to embed a curl command somehow to a numeric field - by way of scripted fields setting?


Or another idea is to call a script- IE: python, bash, etc from the file tree somewhere to be executed with the ported field value??

  • Really all I need to do is run a curl command to an external system API. Any ideas appreciated.


Scripted fields intentionally do not support that sort of behavior. Painless (the scripting language used for scripted fields) exposes a very small subset of the Java APIs, and ones involving network or filesystem access are not among them. I'm not sure what your use case is exactly, but you might consider running an ES query on an interval via a script and responding to the results in whatever fashion you wish.

Bil much appreciate the responses. Very helpful.

The docs are not too easy to find information in a clear concise manner.. I was just getting into the painless language supporting what Java functions, as well as seeing what I could do with Groovy.

My use case capability is this: From an event field, be able to click the data point and execute a curl API command that passes the field data.

I have done this with "another product" that rhymes with junk. Needless to say, the "workflow action" I am after allows me to pass the field data into a pre-formatted curl command - posting to an API server which allows us to execute some internal on-prem "whiz-bang actions".. :slight_smile:
Any further ideas you may have is much appreciated.

If doing a GET will suffice, then you could use a URL formatter to create a clickable link pointed at the API endpoint and open that in a new tab. You would have to have that return something sensible to display to the user. I tried using a URL formatter to create a javascript link that would use XMLHttpRequest to fire off the request, but the URL formatter does not support that.

Sounds like we need to build something custom like a modal that sits on top of the HTML5 by way of a plugin that enables the features for each field. I have a goal set of drop-downs , so this really defines a need for a custom piece.

Thanks again!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.