Skip to content

Instantly share code, notes, and snippets.

@AviranAbady
AviranAbady / elasticsearch reindex inline script.json
Created May 20, 2021 08:37
Elasticsearch reindex with inline script - casting of nested values
POST _reindex
{
"source": {
"index": "vehicles"
},
"dest": {
"index": "vehicels-back"
},
"script": {
"lang": "painless",
@AviranAbady
AviranAbady / lambda_edge_request_sample.json
Created May 17, 2021 15:26
Lambda Edge sample request
{
"Records": [
{
"cf": {
"config": {
"distributionId": "EDFDVBD6EXAMPLE"
},
"request": {
"clientIp": "2001:0db8:85a3:0:0:8a2e:0370:7334",
"method": "GET",
@AviranAbady
AviranAbady / reindex with pipeline.yaml
Created May 16, 2021 08:17
Elasticsearch reindex with pipeline
POST _reindex
{
"source": {
"index": "route_policy"
},
"dest": {
"index": "route_policy_back",
"pipeline": "route_restriction_date_converter"
}
@AviranAbady
AviranAbady / update by query with params.yaml
Created May 13, 2021 08:47
Elasticsearch update by query using params to set an object
POST management_users/_update_by_query
{
"script": {
"source": "ctx._source.web_permissions=params.web_permissions",
"params": {
"web_permissions": {
"allowed_actions": [],
"permissions_group_name": "full_control",
"permissions_group_id": "f-AbVXgBawR5qZFRXLTM",
"permissions_group_label": "Full control"
#aws root partition resize
growpart /dev/xvda 1
resize2fs /dev/xvda1
@AviranAbady
AviranAbady / elasticsearch reindex nested date formats.json
Created April 13, 2021 19:24
elasticsearch reindex nested date formats
PUT _ingest/pipeline/route_restriction_date_converter
{
"description": "Convert dates to ISO format",
"processors": [
{
"date": {
"field": "start_date",
"target_field": "start_date",
"formats": [