# system.util.queryAuditLog targetFilter wildcard

**URL:** <https://forum.inductiveautomation.com/t/system-util-queryauditlog-targetfilter-wildcard/83338>\
**Category:** Ignition\
**Tags:** perspective, scripting, ignition81\
**Created:** [December 20, 2023, 1:26am UTC](https://forum.inductiveautomation.com/t/system-util-queryauditlog-targetfilter-wildcard/83338 "2023-12-20T01:26:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [December 20, 2023, 1:26am UTC](https://forum.inductiveautomation.com/t/system-util-queryauditlog-targetfilter-wildcard/83338/1 "2023-12-20T01:26:29Z")

</div>

Similar to this post, I would like to use a filter on `action_target` with a wildcard.

> [@Audit log - target filter with wildcard or list](https://forum.inductiveautomation.com/t/audit-log-target-filter-with-wildcard-or-list/7078):
>
> Ignition 7.6.2 With the binding function “Audit log” on a table component or the system.util.queryAuditLog function, in the target filter, I would like to use wilcards or list of filter (like with alarm status)

This works

```auto
system.util.queryAuditLog(auditProfileName='Audit', targetFilter='%MyTP]My/Tag/Something%')

```

but this doesn't

```auto
system.util.queryAuditLog(auditProfileName='Audit', targetFilter='%[MyTP]My/Tag/Something%')

```

Basically, if I remove the first `[` from the tag provider and include the `%` it works, with the bracket and with or without `%` does not. I copied the value directly from the table so I know it's correct.

Any ideas?  
On 8.1.35

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 20, 2023, 1:49am UTC](https://forum.inductiveautomation.com/t/system-util-queryauditlog-targetfilter-wildcard/83338/2 "2023-12-20T01:49:56Z")

</div>

Regex syntax, perhaps? Try a pair of backslashes in front of the left bracket.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [December 20, 2023, 1:54am UTC](https://forum.inductiveautomation.com/t/system-util-queryauditlog-targetfilter-wildcard/83338/3 "2023-12-20T01:54:47Z")

</div>

That didn't seem to work for me either.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [December 22, 2023, 6:44pm UTC](https://forum.inductiveautomation.com/t/system-util-queryauditlog-targetfilter-wildcard/83338/4 "2023-12-22T18:44:03Z")

</div>

This wasn't anything related to Ignition, rather the database, which sadly enough for my project is MSSQL. Most likely other databases like MySql, Postgres, won't run into this issue but I don't have them installed to check.

So, dropping the first bracket or doing as they suggest in these links will work.

> <https://stackoverflow.com/questions/3661125/sql-server-like-containing-bracket-characters>

> **[LIKE (Transact-SQL) - SQL Server](https://learn.microsoft.com/en-us/sql/t-sql/language-elements/like-transact-sql?view=sql-server-ver16&redirectedfrom=MSDN)**
>
> Determines whether a specific character string matches a specified pattern.
