Queries in both KQL and Lucene fail to do a full match on Powershell Cmdlets
Asked Elastic on their slack, and already tried the following with no success:
Changing language (Tried with both KQL and Lucene)
Wrapping in Double quotes -> Not full match, "Get-ChromeDump" matches "Function Get-ErrorInELK{ #ChromeDump" and "Get-ChromeDump"
Use Wildcards -> No results
Use both Double quotes and wildcards -> Not full match, "*Get-ChromeDump*" matches "Function Get-ErrorInELK{ #ChromeDump" and "Get-ChromeDump"
The field is of the field type Keyword and is the only one that contains the information that I need.
Powershell Logs collected by both Elastic Agent and Winlogbeat are useless if I can't query cmdlets...There is any configuration that needs to be done to enable this?
It seems that the field powershell.file.script_block_text is of type text and it is using the standard tokenizer so hyphens are treated as word separators.
We could take a look at what alternative could be good for it instead of the current tokenizer. In the meantime, can you get that value from any other field in the event or it appears just in that one text?
Based on the title I assume this also applies to Elastic Agent. Elastic Agent uses a bit a different indexing strategy than winlogbeat. On how to change templates for Elastic Agent, here a few notes that could be helpful: https://github.com/elastic/beats/pull/23247/files
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.