REST Management API - Cannot get it to work with DLS

15 views
Skip to first unread message

Terry Quigley

unread,
Sep 1, 2017, 8:55:00 AM9/1/17
to Search Guard Community Forum
Hi

Do you have any examples of how a _dls_ query should be written via the Roles API . I can't find any documentation with examples. This post states it should be supported https://groups.google.com/forum/#!topic/search-guard/KLGE1vxdAxQ 

If I save down the following example the query is ignored:

{"indices":{"*":{"*":["SEARCH"],"_dls_":"'{\"bool\":{\"filter\":[{\"type\":{\"value\":\"countries\"}}]}}'"}}}

This is how it is stored when I query via sg_admin.

_dls_: "'{\"bool\":{\"filter\":[{\"type\":{\"value\":\"countries\"}}]}}'"

I can also use sg_admin to reload the role so that the start / end quotes and the escaping backslashes are removed. This works: 

_dls_: '{"bool" : {"filter": {"type" : { "value" : "countries"}}}}'

but I can't save it down like that via the REST API.

How should I proceed ?

Thanks

Terry Quigley

unread,
Sep 1, 2017, 9:38:20 AM9/1/17
to Search Guard Community Forum
After wrestling with this for a day I solved it within minutes of posting this question :

The answer was not to use single quotes anywhere when saving the _dls_ field down via the REST API.

It would be good if this were documented somewhere though.

Thanks

SG

unread,
Sep 1, 2017, 3:31:58 PM9/1/17
to search...@googlegroups.com
thx for letting us know. we will update the docs accordingly
> --
> You received this message because you are subscribed to the Google Groups "Search Guard Community Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to search-guard...@googlegroups.com.
> To post to this group, send email to search...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/search-guard/f1a374d8-971b-414b-b34b-e5f614c81cd1%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages