2022-01-25 11:25:20 +03:00
|
|
|
res=''
|
2022-07-05 08:43:17 +03:00
|
|
|
port=$1
|
|
|
|
echo "Warning Elastic to up and running with attachment processor... ${port}"
|
2022-01-25 11:25:20 +03:00
|
|
|
while true
|
|
|
|
do
|
2022-07-05 08:43:17 +03:00
|
|
|
res=$(curl -s -XPUT "localhost:${port}/_ingest/pipeline/attachment?pretty" -H 'Content-Type: application/json' -d'
|
2022-01-25 11:25:20 +03:00
|
|
|
{
|
|
|
|
"description" : "Field for processing file attachments",
|
|
|
|
"processors" : [
|
|
|
|
{
|
|
|
|
"attachment" : {
|
|
|
|
"field" : "data"
|
|
|
|
},
|
|
|
|
"remove" : {
|
|
|
|
"field" : "data"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
')
|
|
|
|
if [[ $res = *"acknowledged"* ]]; then
|
|
|
|
echo "Elastic processor is up and running..."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
sleep 1
|
|
|
|
done
|