1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/ipprefix-aggregation.asciidoc:14
[source, python]
----
resp = client.indices.create(
index="network-traffic",
mappings={
"properties": {
"ipv4": {
"type": "ip"
},
"ipv6": {
"type": "ip"
}
}
},
)
print(resp)
resp1 = client.bulk(
index="network-traffic",
refresh=True,
operations=[
{
"index": {
"_id": 0
}
},
{
"ipv4": "192.168.1.10",
"ipv6": "2001:db8:a4f8:112a:6001:0:12:7f10"
},
{
"index": {
"_id": 1
}
},
{
"ipv4": "192.168.1.12",
"ipv6": "2001:db8:a4f8:112a:6001:0:12:7f12"
},
{
"index": {
"_id": 2
}
},
{
"ipv4": "192.168.1.33",
"ipv6": "2001:db8:a4f8:112a:6001:0:12:7f33"
},
{
"index": {
"_id": 3
}
},
{
"ipv4": "192.168.1.10",
"ipv6": "2001:db8:a4f8:112a:6001:0:12:7f10"
},
{
"index": {
"_id": 4
}
},
{
"ipv4": "192.168.2.41",
"ipv6": "2001:db8:a4f8:112c:6001:0:12:7f41"
},
{
"index": {
"_id": 5
}
},
{
"ipv4": "192.168.2.10",
"ipv6": "2001:db8:a4f8:112c:6001:0:12:7f10"
},
{
"index": {
"_id": 6
}
},
{
"ipv4": "192.168.2.23",
"ipv6": "2001:db8:a4f8:112c:6001:0:12:7f23"
},
{
"index": {
"_id": 7
}
},
{
"ipv4": "192.168.3.201",
"ipv6": "2001:db8:a4f8:114f:6001:0:12:7201"
},
{
"index": {
"_id": 8
}
},
{
"ipv4": "192.168.3.107",
"ipv6": "2001:db8:a4f8:114f:6001:0:12:7307"
}
],
)
print(resp1)
----
|