OpenObserve Docs
ReferenceApiFunctions

Update function

Updated View MarkdownOpen in ChatGPTOpen in Claude

Endpoint: PUT /api/{organization}/functions/{name}

Returns 404 ("Function not found") if no function with that name exists. If the body is identical to the stored function, the stored function is returned unchanged.

Function can be used to modify input data. You can use it to drop some fields, convert some field's data type, or drop some records.

Request

{
	"name": "add_env",
	"function": ".env = \"prod\"\n.",
	"transType": 0
}

Description

Field nameData typeDefault valueDescription
namestring-function name, required
functionstring-function body, required. For VRL, a trailing . is added if missing
transTypeint00 = VRL, 1 = JavaScript
paramsstring-optional, function parameters

Response

{
	"code": 200,
	"message": "Function saved successfully"
}
Was this page helpful?

On this page