Auto-generated code for main (#2473)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
This commit is contained in:
36
docs/doc_examples/216e24f05cbb82c1718713fbab8623d2.asciidoc
Normal file
36
docs/doc_examples/216e24f05cbb82c1718713fbab8623d2.asciidoc
Normal file
@ -0,0 +1,36 @@
|
||||
// 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: "geoip",
|
||||
description: "Add ip geolocation info",
|
||||
processors: [
|
||||
{
|
||||
geoip: {
|
||||
field: "ip",
|
||||
target_field: "geo",
|
||||
database_file: "GeoLite2-Country.mmdb",
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.index({
|
||||
index: "my-index-000001",
|
||||
id: "my_id",
|
||||
pipeline: "geoip",
|
||||
document: {
|
||||
ip: "89.160.20.128",
|
||||
},
|
||||
});
|
||||
console.log(response1);
|
||||
|
||||
const response2 = await client.get({
|
||||
index: "my-index-000001",
|
||||
id: "my_id",
|
||||
});
|
||||
console.log(response2);
|
||||
----
|
||||
Reference in New Issue
Block a user