Files
elasticsearch-js/docs/doc_examples/6fbb88f399618e1b47412082062ce2bd.asciidoc
2024-07-29 17:10:05 -05:00

45 lines
832 B
Plaintext

// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.transform.previewTransform({
source: {
index: "kibana_sample_data_logs",
},
pivot: {
group_by: {
timestamp: {
date_histogram: {
field: "timestamp",
fixed_interval: "1h",
},
},
},
aggregations: {
"bytes.max": {
max: {
field: "bytes",
},
},
top: {
top_metrics: {
metrics: [
{
field: "clientip",
},
{
field: "geo.src",
},
],
sort: {
bytes: "desc",
},
},
},
},
},
});
console.log(response);
----