# F5 APM: Deleting domain-groups entries / trim list

**URL:** <https://community.f5.com/t/f5-apm-deleting-domain-groups-entries-trim-list/72190>\
**Category:** Technical Forums\
**Tags:** application-delivery\
**Created:** [April 22, 2023, 2:57pm UTC](https://community.f5.com/t/f5-apm-deleting-domain-groups-entries-trim-list/72190 "2023-04-22T14:57:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cory\_O](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/cory_o/32/458_2.png) [@Cory\_O](https://community.f5.com/u/Cory_O)\
**Post date:** [April 22, 2023, 2:57pm UTC](https://community.f5.com/t/f5-apm-deleting-domain-groups-entries-trim-list/72190/1 "2023-04-22T14:57:55Z")

</div>

Hey everyone,

When I go to remove some domain-groups, I’ll use the following CLI command as an example:

```tcl
tmsh modify apm profile access MYACCESSPROFILE_LTM-APM_access_profile domain-groups delete { authdomain5 authdomain6 authdomain9 }

```

The problem is, running this command leaves “holes” in that it doesn’t trim the rest of the list down.&nbsp; In other words, the above command will leave authdomain6, authdomain6, and authdomain9 objects empty instead of shortening the entire list by 3.

Is there a CLI command to trim down the list and remove the empty objects?

Thanks!

---

<div class="post-metadata">

**Author:** ![G-Rob](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/g-rob/32/17616_2.png) [@G-Rob](https://community.f5.com/u/G-Rob)\
**Post date:** [April 24, 2023, 1:13pm UTC](https://community.f5.com/t/f5-apm-deleting-domain-groups-entries-trim-list/72190/2 "2023-04-24T13:13:48Z")

</div>

Cory,

Which version of TMOS are you using? This should be reported via support case, I believe.

Thanks

---

<div class="post-metadata">

**Author:** ![Cory\_O](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/cory_o/32/458_2.png) [@Cory\_O](https://community.f5.com/u/Cory_O)\
**Post date:** [April 24, 2023, 3:02pm UTC](https://community.f5.com/t/f5-apm-deleting-domain-groups-entries-trim-list/72190/3 "2023-04-24T15:02:23Z")

</div>

Good morning!

I’ve seen this issue across TMOS versions 12.1.5.3 and 14.1.5.3 thus far.

If I run this command, three new objects are created in the positions mentioned:

```tcl
tmsh modify apm profile access MYACCESSPROFILE_LTM-APM_access_profile domain-groups add { authdomain47 { cookie-domain none cookie-host testapp1.iamaserver.com httponly-cookie false persistent-cookie false secure-cookie true sso-name none } authdomain48 { cookie-domain none cookie-host testapp2.iamaserver.com httponly-cookie false persistent-cookie false secure-cookie true sso-name none } authdomain49 { cookie-domain none cookie-host testapp3.iamaserver.com httponly-cookie false persistent-cookie false secure-cookie true sso-name none } }

```

I then run the commands to Apply the Access Policy and save.&nbsp; Following this, I can run the following command to list the new entries:

```tcl
tmsh list apm profile access MYACCESSPROFILE_LTM-APM_access_profile domain-groups

```

The end of the results shows up as expected:

```tcl
authdomain47 {
            app-service none
            cookie-domain none
            cookie-host testapp1.iamaserver.com
            httponly-cookie false
            persistent-cookie false
            secure-cookie true
            sso-name none
        }
        authdomain48 {
            app-service none
            cookie-domain none
            cookie-host testapp2.iamaserver.com
            httponly-cookie false
            persistent-cookie false
            secure-cookie true
            sso-name none
        }
        authdomain49 {
            app-service none
            cookie-domain none
            cookie-host testapp3.iamaserver.com
            httponly-cookie false
            persistent-cookie false
            secure-cookie true
            sso-name none
        }
    }
}

```

Now I’ll try deleting authdomain48:

```tcl
tmsh modify apm profile access MYACCESSPROFILE_LTM-APM_access_profile domain-groups delete { authdomain48 }

```

I apply the Access Profile, save, and run another list.&nbsp; This time, you’ll see the result is missing authdomain 48 instead of consolidating 49 to position 48:

```tcl
authdomain47 {
            app-service none
            cookie-domain none
            cookie-host testapp1.iamaserver.com
            httponly-cookie false
            persistent-cookie false
            secure-cookie true
            sso-name none
        }
        authdomain49 {
            app-service none
            cookie-domain none
            cookie-host testapp3.iamaserver.com
            httponly-cookie false
            persistent-cookie false
            secure-cookie true
            sso-name none
        }
    }
}

```

Deleting the entries via the GUI has the same effect.&nbsp; That’s why I was just looking for a command to trim the list down.&nbsp; I can open a SR if that’s what you suggest.

---

<div class="post-metadata">

**Author:** ![Cory\_O](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/cory_o/32/458_2.png) [@Cory\_O](https://community.f5.com/u/Cory_O)\
**Post date:** [April 24, 2023, 3:39pm UTC](https://community.f5.com/t/f5-apm-deleting-domain-groups-entries-trim-list/72190/4 "2023-04-24T15:39:51Z")

</div>

At this juncture, unless told otherwise, I would imagine using the replace-all-with command instead of delete would be the only way to “consolidate” the list as the entries appear to remain static.&nbsp; This can obviously be tedious if you have a significant amount of entries to re-order, but I imagine that would work.&nbsp; Let me know what everyone thinks and tap “Accept as Solution” if you agree.

---

<div class="post-metadata">

**Author:** ![G-Rob](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/g-rob/32/17616_2.png) [@G-Rob](https://community.f5.com/u/G-Rob)\
**Post date:** [April 24, 2023, 3:43pm UTC](https://community.f5.com/t/f5-apm-deleting-domain-groups-entries-trim-list/72190/5 "2023-04-24T15:43:31Z")

</div>

I would agree with this. I do not believe that TMOS is viewing that as a sequential list, thus replace-all-with may be easier if you want sequential naming.
