Search code examples
pilosa

How to list index names in pilosa without the complete schema


curl -XGET localhost:10101/index will returns the schema of the specified index in JSON. How can i get only the names of indices present in pilosa without returning the complete schema?


Solution

  • One option is to use a command line tool to parse and filter the JSON response. For example, using jq:

    curl localhost:10101/schema | jq .indexes[].name
    

    will return a quoted list of names, one on each line:

    "index1"
    "index2"
    

    You can also pass -r to jq if you don't want the quotes.