# Help with filter on custom variables

**URL:** <https://community.icinga.com/t/help-with-filter-on-custom-variables/7976>\
**Category:** Icinga 2\
**Created:** [August 11, 2021, 9:46am UTC](https://community.icinga.com/t/help-with-filter-on-custom-variables/7976 "2021-08-11T09:46:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![queoadmin](https://community.icinga.com/letter_avatar_proxy/v4/letter/q/d07c76/32.png) [@queoadmin](https://community.icinga.com/u/queoadmin)\
**Post date:** [August 11, 2021, 9:46am UTC](https://community.icinga.com/t/help-with-filter-on-custom-variables/7976/1 "2021-08-11T09:46:06Z")

</div>

Hi all!

I have a couple of services in my Icinga defined so:

> object Service “[System] System Load [T97332]” {  
> …  
> vars.specialperms = “Devs”  
> }

then I defined an API user as:

> object ApiUser “api\_devs” {  
> password = CONSTANT\_PasswdApiUserDevs  
> permissions = [  
> {  
> permission = “actions/\*”  
> filter = {{ regex(“^Devs”, service.vars.specialperms) }}  
> }  
> ]  
> }

Now I’d like to define a downtime for all these services and I try so:

> curl -k -s -u api\_devs:mypass -H ‘Accept: application/json’   
> -X POST ‘[https://localhost:5665/v1/actions/schedule-downtime](https://localhost:5665/v1/actions/schedule-downtime)’   
> -d “$(jo -p pretty=true type=Service filter=“service.vars.specialperms == "Devs")”   
> author=DEVS comment=“TEST”   
> fixed=true start\_time=$(date “+%s”) end\_time=$(date “+%s” -d “+1 minutes”))”

Unfortunately it does not work and I get always:

> {  
> “error”: 404.0,  
> “status”: “No objects found.”  
> }

Could someone say me where is my error?  
I use Icinga 2.10.3-1 from Debian 10 repositories.

Thanks a lot  
Luca

---

<div class="post-metadata">

**Author:** ![theFeu](https://community.icinga.com/user_avatar/community.icinga.com/thefeu/32/7277_2.png) [@theFeu](https://community.icinga.com/u/theFeu)\
**Post date:** [August 12, 2021, 9:43am UTC](https://community.icinga.com/t/help-with-filter-on-custom-variables/7976/2 "2021-08-12T09:43:03Z")

</div>

Hello there,  
sadly I can’t help you with your topic but I would like to point you to our [markdown formatting guidelines](https://community.icinga.com/t/create-topics-and-master-markdown-formatting/69) so your post is more readable 🙂
