end_date=$(date -d ‘-2 week’ ‘+%Y-%m-%dT%H:%M:%S.000Z’) date_range=‘{ “criteria”: { “last_contact_time”: { “start”: “2017-08-27T00:00:00.000Z”, “end”: “‘$end_date’” } } }' curl -H X-Auth-Token:$token -H “Content-Type: application/json” -s -k -X POST -d “$date_range” “$url/appservices/v6/orgs/$orgkey/devices/_search”
end_date=$(date -d ‘-2 week’ ‘+%Y-%m-%dT%H:%M:%S.000Z’) date_range='{ "criteria": { "last_contact_time": { "start": "2017-08-27T00:00:00.000Z", "end": "'$end_date'" }, "rows": 10000 }' curl -H X-Auth-Token:$token -H “Content-Type: application/json” -s -k -X POST -d “$date_range” “$url/appservices/v6/orgs/$orgkey/devices/_search”