# Using the --tags option with @elastic/synthetics

**URL:** <https://discuss.elastic.co/t/using-the-tags-option-with-elastic-synthetics/330681>\
**Category:** Synthetics\
**Created:** [April 24, 2023, 6:10pm UTC](https://discuss.elastic.co/t/using-the-tags-option-with-elastic-synthetics/330681 "2023-04-24T18:10:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![spaulovich](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@spaulovich](https://discuss.elastic.co/u/spaulovich)\
**Post date:** [April 24, 2023, 6:10pm UTC](https://discuss.elastic.co/t/using-the-tags-option-with-elastic-synthetics/330681/1 "2023-04-24T18:10:31Z")

</div>

Any hints to correctly using the --tags option with @elastic/synthetics?

Assuming a journey where I've added `monitors.use({ tags: ["foo", "bar"] })`

If I run `npx @elastic/synthetics . --tags "foo"` I get **No tests found!**

I've tried permutations with --tags like `--tags "[foo]"` and `--tags "['foo']"` and `--tags foo` but get the same **No tests found!** result.

What's the correct syntax for using the --tags option?

---

<div class="post-metadata">

**Author:** ![spaulovich](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@spaulovich](https://discuss.elastic.co/u/spaulovich)\
**Post date:** [May 3, 2023, 2:49pm UTC](https://discuss.elastic.co/t/using-the-tags-option-with-elastic-synthetics/330681/2 "2023-05-03T14:49:34Z")

</div>

Bumping this. Still haven't gotten the --tags to work as expected, or haven't clearly understood how it's supposed to work. Can anyone provide insight?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 24, 2023, 10:50am UTC](https://discuss.elastic.co/t/using-the-tags-option-with-elastic-synthetics/330681/3 "2023-05-24T10:50:15Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![shahzad31](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shahzad31/32/51637_2.png) [@shahzad31](https://discuss.elastic.co/u/shahzad31)\
**Post date:** [June 21, 2023, 1:50pm UTC](https://discuss.elastic.co/t/using-the-tags-option-with-elastic-synthetics/330681/4 "2023-06-21T13:50:28Z")

</div>

Apologies for delay, we have an issue open to address this

> <https://github.com/elastic/synthetics/issues/780>
>
> There has been some confusion over the current implementation of tags because it… differs from what is expected (for example as raised in https://github.com/elastic/synthetics/issues/775).
> 
> Synthetics needs to be updated to consolidate how \`tags\` (and \`match\` in the CLI) work, as follows:
> \- Remove \`--tags\` and \`--match\` from \`push\`
> - If either \`--tags\` or \`--match\` is used with \`push\`, fail the \`push\` with an error and print a message
> | push cannot be used with either '--tags' or '--match', see \[link to forum post\] for more on why we removed this broken behavior.
> - Add a deprecation notice to the release note including this change
> - Update the \`push --help\` text that currently suggests it will filter on \`push\`
> - Note that \`--tags\` and \`--match\` are still valid options for \_running\_ monitors (but not with \`push\`)
> - Update the \[docs page\](https://www.elastic.co/guide/en/observability/current/synthetics-command-reference.html) that \`--tags\` and \`--match\` are only relevant when running monitor (not pushing them)
> \- Tags defined for an \*\*individual monitor\*\*
> - Tags can continue to be defined for an individual monitor via:
> - \`monitor.use.tags\` of \`journey({name:'My Monitor', tags:\['foo'\]}, …\`
> - Note that the \`journey()\` version is not documented or intended for general use (will maybe documented in the future if there's a need)
> \- Add \`monitor.use.tags\` support to the \`synthetics.config.ts\`
> - Precedence order is that this global setting is overridden by any monitor specific setting for \`tags\`
> - Either \`monitor.use.tags\` or \`journey…\` type of definition
> - i.e. the behaviour is consistent with \`locations\`
> \- Tags defined against a monitor in any way are then reflected in the Synthetics UI monitor tags
> \- Add a sticky forum post for a month or so describing the change
