# Please help figure out the right syntax

**URL:** <https://discuss.elastic.co/t/please-help-figure-out-the-right-syntax/167104>\
**Category:** Elasticsearch\
**Created:** [February 5, 2019, 11:06am UTC](https://discuss.elastic.co/t/please-help-figure-out-the-right-syntax/167104 "2019-02-05T11:06:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jurz](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jurz](https://discuss.elastic.co/u/jurz)\
**Post date:** [February 5, 2019, 11:06am UTC](https://discuss.elastic.co/t/please-help-figure-out-the-right-syntax/167104/1 "2019-02-05T11:06:19Z")

</div>

Hi,

re-read search syntax post serveral times over - still unable to do what I need.

Here's the situation: Gathering logs from windows event log, have lots iwth event id 4625 and in some cases the event\_data.TargetUserName is a machine (having at the end of the name, like CPU1, MACHINE2$ etc).

I want to find all records with event\_id:4625, but the not the machine accounts.

Here is what I have tried (with no success) - problem seems to be escaping dollar sign.  
event\_id:4625 NOT event\_data.TargetUserName:"_" event\_id:4625 -event\_data.TargetUserName:"\*"  
event\_id:4625 NOT event\_data.TargetUserName:/(._)$/ (and several other options)

Anyone facing similar problem?  
Thanks, J

---

<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:** [March 5, 2019, 11:06am UTC](https://discuss.elastic.co/t/please-help-figure-out-the-right-syntax/167104/2 "2019-03-05T11:06:22Z")

</div>

Closed on March 5, 2019, 11:06am UTC

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