Skip to content

Add parameter to use patterned_text for message field#802

Merged
parkertimmins merged 5 commits intomasterfrom
parker/add-patterned-text-messages
Jun 30, 2025
Merged

Add parameter to use patterned_text for message field#802
parkertimmins merged 5 commits intomasterfrom
parker/add-patterned-text-messages

Conversation

@parkertimmins
Copy link
Contributor

Add parameter patterned_text_message_field to logs track. If set to true, all message and error.message fields in the elastic logs track will be of type patterned_text. If set to false, type will be match_only_text. Defaults to false.

@parkertimmins parkertimmins requested a review from martijnvg June 26, 2025 14:30
@parkertimmins
Copy link
Contributor Author

parkertimmins commented Jun 26, 2025

There are no queries which explicitly search for message or error.messag. However, there are many workflows with multi_match and multi_match with type=phrase. @martijnvg Do you think these are sufficient? Or should we add some explicit match and match_phrase queries on message fields?

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@martijnvg
Copy link
Member

Do you think these are sufficient? Or should we add some explicit match and match_phrase queries on message fields?

I thought the queries always relied on the default query fields and iirc message if part of that list. If that isn't the case then queries directly on message field makes sense.

@parkertimmins
Copy link
Contributor Author

Ahh, you're correct. Every index does define a list of default fields and the message fields are in those lists.

"type": "wildcard"
},
"message": {
{% if p_patterned_text_message_field %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p_patterned_text_message_field is undefined in template context, because templates are not rendered under track.json tree.

The fix options are:

  • repeat p_patterned_text_message_field definition at the top of each template file:
{% set p_patterned_text_message_field = (patterned_text_message_field | default(false)) %}
  • use patterned_text_message_field directly with relevant default(false) filter expression.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps default(false) is not even needed, worth a check.

@parkertimmins parkertimmins merged commit a8154ab into master Jun 30, 2025
25 checks passed
jordan-powers added a commit to jordan-powers/rally-tracks that referenced this pull request Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments