(cherry picked from commit f737290d10)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
32 lines
590 B
Plaintext
32 lines
590 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.ingest.putPipeline({
|
|
id: "set_os",
|
|
description: "sets the value of host.os.name from the field os",
|
|
processors: [
|
|
{
|
|
set: {
|
|
field: "host.os.name",
|
|
value: "{{{os}}}",
|
|
},
|
|
},
|
|
],
|
|
});
|
|
console.log(response);
|
|
|
|
const response1 = await client.ingest.simulate({
|
|
id: "set_os",
|
|
docs: [
|
|
{
|
|
_source: {
|
|
os: "Ubuntu",
|
|
},
|
|
},
|
|
],
|
|
});
|
|
console.log(response1);
|
|
----
|