Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

Here some hints how to query elasticSearch from your web browser

First of all ElasticSearch has an excellent web site with a lot of documentation:

https://www.elastic.co/guide/en/elasticsearch/guide/current/index.html

To inspect your indexes following functions are very helpfull:

Queries

search (_search)

with "_search" you can search for specific index types. e.g. "workflow" index types:

http://172.17.2.91:9200/workflow/_search

display (?pretty)

with "?pretty" the content will be displaied in a structured way

http://172.17.2.91:9200/workflow/_search?pretty

amount of objects (&size)

if you wnat to see more than 10 objects ausgegeben use the option "size". "Size" defines the amount of ibjects to display e.g. 100

http://172.17.2.91:9200/workflow/_search?pretty&size=100

filter (&q=<feld>:<wert>)

IF you wnat to filter the objects you can use the function "&q=" e.g. filter attribute "status" for content "11":

http://172.17.2.91:9200/workflow/_search?pretty&size=100&q=status:11

If there are spaces in the filter expression use brackets:

http://172.17.2.91:9200/workflow/_search?pretty&size=100&q=status:(NOT DENIED)

boolean expression

You can use boolean expression to define a more complex query (use "\" to escape blanks in attribute names like "Object Name"):

http://uxlpdipacd00001:5151/audit-default-2020*/_search?pretty&size=1000&q=Object\%20Name:00386109914%20or%20Object\%20Name:00386109914

nodes (_node/os?pretty)

If you want to see how many nodes and cpu's are used by ES

http://172.17.2.91:9200/_nodes/os?pretty

index statistics (/<index>/_stats?pretty)

if you need statistics about your index you can use this command like

acd30.skypro.ch:3191/elasticsearch/audit*/_stats?pretty

TTL

To test TTL, you should know that you cannot view the TTL field value. You need to explicitly ask for it with body request parameter fields. Look at this articel

https://makina-corpus.com/blog/metier/2015/elasticsearch-how-to-test-working-ttl-documents

  • No labels