how can I put parameters in ElasticSearch curl post how can I put parameters in ElasticSearch curl post elasticsearch elasticsearch

how can I put parameters in ElasticSearch curl post


You need to enclose $username in double quotes since it's a string. That will work.

username="Tom"curl -XPOST 'http://192.168.0.1:9200/userdb/info/1' -d "{\"user\":\"$username\"}"                                                       ^           ^         ^  ^                                                       |           |         |  |                                                     here         here  and  here