Search Fields Through a Given Pattern - Example 2

Perform flexible case matching for field values using the wildcard() function

Query

logscale
wildcard(field=animal, pattern=horse, ignoreCase=true)

Introduction

Given the following events:

fieldvalue
animalhorse
animalHorse
animalduck
animalHORSES
animalcrazy hOrSe
animalhooorse
animaldancing with horses

Finds events where the field animal contains the value horse, and makes it case-insensitive.

Step-by-Step

  1. Starting with the source repository events.

  2. logscale
    wildcard(field=animal, pattern=horse, ignoreCase=true)

    Filters for elements in the field animal that match horse, case-insensitive.

  3. Event Result set.

Summary and Results

The result is a list of events where field animal contains any capitalization of horse (HORSE, hOrsE, Horse, etc.).

The query used is equivalent to animal=/\Ahorse\z/i.

Note that it is anchored.