curl --request POST \
--url https://api.honeycomb.io/1/derived_columns/{datasetSlug} \
--header 'Content-Type: application/json' \
--header 'X-Honeycomb-Team: <api-key>' \
--data '
{
"alias": "<string>",
"expression": "<string>",
"description": ""
}
'import requests
url = "https://api.honeycomb.io/1/derived_columns/{datasetSlug}"
payload = {
"alias": "<string>",
"expression": "<string>",
"description": ""
}
headers = {
"X-Honeycomb-Team": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Honeycomb-Team': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({alias: '<string>', expression: '<string>', description: ''})
};
fetch('https://api.honeycomb.io/1/derived_columns/{datasetSlug}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.honeycomb.io/1/derived_columns/{datasetSlug}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'alias' => '<string>',
'expression' => '<string>',
'description' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Honeycomb-Team: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.honeycomb.io/1/derived_columns/{datasetSlug}"
payload := strings.NewReader("{\n \"alias\": \"<string>\",\n \"expression\": \"<string>\",\n \"description\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Honeycomb-Team", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.honeycomb.io/1/derived_columns/{datasetSlug}")
.header("X-Honeycomb-Team", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"alias\": \"<string>\",\n \"expression\": \"<string>\",\n \"description\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeycomb.io/1/derived_columns/{datasetSlug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Honeycomb-Team"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"alias\": \"<string>\",\n \"expression\": \"<string>\",\n \"description\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"id": "yUheCUmgZ8p",
"alias": "one",
"description": "just one",
"expression": "INT(1)",
"created_at": "2022-07-26T22:38:04Z",
"updated_at": "2022-11-16T17:34:01Z"
}{
"status": 400,
"type": "https://api.honeycomb.io/problems/unparseable",
"title": "The request body could not be parsed.",
"error": "invalid gzip data"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Rate Limited"
}Create a Calculated Field
Create a Calculated Field (also called a Derived Column). Calculated Fields allow you to run queries based on the value of an expression that is calculated from the fields in an event.
curl --request POST \
--url https://api.honeycomb.io/1/derived_columns/{datasetSlug} \
--header 'Content-Type: application/json' \
--header 'X-Honeycomb-Team: <api-key>' \
--data '
{
"alias": "<string>",
"expression": "<string>",
"description": ""
}
'import requests
url = "https://api.honeycomb.io/1/derived_columns/{datasetSlug}"
payload = {
"alias": "<string>",
"expression": "<string>",
"description": ""
}
headers = {
"X-Honeycomb-Team": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Honeycomb-Team': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({alias: '<string>', expression: '<string>', description: ''})
};
fetch('https://api.honeycomb.io/1/derived_columns/{datasetSlug}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.honeycomb.io/1/derived_columns/{datasetSlug}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'alias' => '<string>',
'expression' => '<string>',
'description' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Honeycomb-Team: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.honeycomb.io/1/derived_columns/{datasetSlug}"
payload := strings.NewReader("{\n \"alias\": \"<string>\",\n \"expression\": \"<string>\",\n \"description\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Honeycomb-Team", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.honeycomb.io/1/derived_columns/{datasetSlug}")
.header("X-Honeycomb-Team", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"alias\": \"<string>\",\n \"expression\": \"<string>\",\n \"description\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeycomb.io/1/derived_columns/{datasetSlug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Honeycomb-Team"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"alias\": \"<string>\",\n \"expression\": \"<string>\",\n \"description\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"id": "yUheCUmgZ8p",
"alias": "one",
"description": "just one",
"expression": "INT(1)",
"created_at": "2022-07-26T22:38:04Z",
"updated_at": "2022-11-16T17:34:01Z"
}{
"status": 400,
"type": "https://api.honeycomb.io/problems/unparseable",
"title": "The request body could not be parsed.",
"error": "invalid gzip data"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Rate Limited"
}Authorizations
Authenticate using a Honeycomb Configuration Key.
Pass the Token in the X-Honeycomb-Team header:
X-Honeycomb-Team: 1234567890123456789012
If you created your key using the API, use data.attributes.secret; this is the same value as the Token in the UI.
To learn how to create a Configuration Key, visit Manage Environment API Keys. To learn more about authenticating requests, visit API Authentication.
Path Parameters
The dataset slug or use __all__ for endpoints that support environment-wide operations.
Body
The human-readable name of the Calculated Field (also called Derived Column), as it will be referenced when building queries.
1 - 255The expression to evaluate to construct this Calculated Field's value. (Calculated Field is also called Derived Column.) Refer to the Calculated Field Reference.
1 - 4095A human-readable description for the Calculated Field that displays in the UI.
255Response
Success
Unique identifier (ID), returned in response bodies.
The human-readable name of the Calculated Field (also called Derived Column), as it will be referenced when building queries.
1 - 255The expression to evaluate to construct this Calculated Field's value. (Calculated Field is also called Derived Column.) Refer to the Calculated Field Reference.
1 - 4095ISO8601 formatted time when the field was created.
ISO8601 formatted time when the field was updated.
A human-readable description for the Calculated Field that displays in the UI.
255