Get Batch Job Logs
curl --request GET \
--url https://api.app.simplismart.ai/external/batch-jobs/{job_name}/logs/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.app.simplismart.ai/external/batch-jobs/{job_name}/logs/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.app.simplismart.ai/external/batch-jobs/{job_name}/logs/', 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.app.simplismart.ai/external/batch-jobs/{job_name}/logs/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.app.simplismart.ai/external/batch-jobs/{job_name}/logs/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.app.simplismart.ai/external/batch-jobs/{job_name}/logs/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.app.simplismart.ai/external/batch-jobs/{job_name}/logs/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"logs": {},
"job_name": "my-job",
"query": "{namespace=\"kuberay\", job=\"kuberay/my-job\"}"
}{
"detail": "Internal error while fetching logs."
}External
Get Batch Job Logs
Returns logs for a batch job. If neither minutes_ago nor hours_ago is set (or both are zero), the last 30 days are returned.
GET
/
external
/
batch-jobs
/
{job_name}
/
logs
/
Get Batch Job Logs
curl --request GET \
--url https://api.app.simplismart.ai/external/batch-jobs/{job_name}/logs/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.app.simplismart.ai/external/batch-jobs/{job_name}/logs/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.app.simplismart.ai/external/batch-jobs/{job_name}/logs/', 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.app.simplismart.ai/external/batch-jobs/{job_name}/logs/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.app.simplismart.ai/external/batch-jobs/{job_name}/logs/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.app.simplismart.ai/external/batch-jobs/{job_name}/logs/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.app.simplismart.ai/external/batch-jobs/{job_name}/logs/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"logs": {},
"job_name": "my-job",
"query": "{namespace=\"kuberay\", job=\"kuberay/my-job\"}"
}{
"detail": "Internal error while fetching logs."
}Authorizations
Simplismart API key (Settings > API Keys).
Path Parameters
Batch job name.
Query Parameters
Look-back window in minutes.
Added to minutes_ago.
Max 5000.
JSON object string applied as line filters. Invalid JSON is ignored.