# FuseQL Search Operators

FuseQL search operators enable both regular and advanced log search (after you choose the **Advanced Search** option). The language specifies the following syntactical rules:

- The search operator must appear before the first pipe (`|`) symbol in the query expression.
- All other operators must follow a valid search expression.

## Operators

### [and](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#and)
Intersection operator (AND logic) between two search operators. Selects results that satisfy both conditions.

### [or](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#or)
Union operator (OR logic) between two search operators. Selects results that satisfy either or both conditions.

### [equal, `=`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#equal)
Searches for specified value; exact match.

### [not equal, `!=`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#not-equal)
Searches for values _**other**_ than the specified value; exact match.

### [greater than, `>`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#greater-than)
Searches for values that are greater than the specified number.

### [greater than or equal, `>=`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#greater-than-or-equal)
Searches for values that are greater than or equal to the specified number.

### [less than, `<`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#less-than)
Searches for values that are less than the specified number.

### [less than or equal, `<=`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#less-than-or-equal)
Searches for values that are less than or equal to the specified number.

### [regex, `=~`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#regex)
Searches for results that match a specific character pattern.

### [not regex, `!~`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#not-regex)
Searches for results that **_do not_** match a specific character pattern.

### [terms exist, `term`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#terms-exist)
Searches to match a specific term; limited to one word.

### [not terms exist, `!term`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#not-terms-exist)
Searches to exclude a specific term; limited to one word.

### [grep, "grep"](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#grep)
Searches for a specific expression (multi-word string) in the log message body.

### [not grep, `!"grep"](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#not-grep)
Searches to exclude a specific expression (multi-word string) in the log message body.

### [facet terms exist, `==`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#facet-terms-exist)
Searches to match a specific facet and its value.

### [facet terms not exist, `!==`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#facet-terms-not-exist)
Searches to exclude a specific facet and its value.

### [starts with, `*~`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#starts-with)
Searches for labels or facets where the value begins with the specified string.

### [ends with, `~*`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#ends-with)
Searches for labels or facets where the value ends with the specified string.

### [contains, `**`](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#contains)
Searches for labels or facets where the value contains the specified string.

### [key exists](https://docs.kloudfuse.com/platform/3.3.6/fuseql-search-operators/#key-exists)
Searches for the presence of a specific facet, regardless of its value.

## Example Syntax

### and, `and`
Intersection operator (AND logic) between two search operators. Selects results that satisfy both conditions.

**Syntax**

Regular search:  
```text
facetName1="value1" facetName2="value2"
```
Advanced search:  
```text
@facetName1="value1" and @facetName2="value2"
```

### or, `or`
Union operator (OR logic) between two search operators. Selects results that satisfy either or both conditions.

**Syntax**

Regular search:  
```text
@facet="valueA OR valueB"
```
Advanced search:  
```text
@facet="valueA" or @facet="valueB"
```

### equal, `=`
Searches for specified value; exact match.

**Syntax**

```text
label="value"
@facetName="value"
```

### not equal, `!=`
Searches for values _**other**_ than the specified value; exact match.

**Syntax**

```text
label!="value"
@facetName!="value"
```

### greater than, `>`
Searches for values that are greater than the specified number.

**Syntax**

```text
@facetName>number
```

### greater than or equal, `>=`
Searches for values that are greater than or equal to the specified number.

**Syntax**

```text
@facetName>=number
```

### less than, `<`
Searches for values that are less than the specified number.

**Syntax**

```text
@facetName<number
```

### less than or equal, `<=`
Searches for values that are less than or equal to the specified number.

**Syntax**

```text
@facetName<=number
```

### regex, `=~`
Searches for results that match a specific character pattern.

**Syntax**

```text
label=~"value"
@facetName=~"value"
```

### not regex, `!~`
Searches for results that **_do not_** match a specific character pattern.

**Syntax**

```text
label!~"value"
@facetName!~"value"
```

### terms exist, `term`
Searches to match a specific term; limited to one word.

**Syntax**

```text
term
```

### not terms exist, `!term`
Searches to exclude a specific term; limited to one word.

**Syntax**

```text
!term
```

### grep, "grep"
Searches for a specific expression (multi-word string) in the log message body.

**Syntax**

```text
"expression"
```

### not grep, `!"grep"`
Searches to exclude a specific expression (multi-word string) in the log message body.

**Syntax**

```text
!"expression"
```

### facet terms exist, `==`
Searches to match a specific facet and its value.

**Syntax**

```text
@facet=="value"
```

### facet terms not exist, `!==`
Searches to exclude a specific facet and its value.

**Syntax**

```text
@facet!=="value"
```

### starts with, `*~`
Searches for labels or facets where the value begins with the specified string.

**Syntax**

```text
label*~"value"
@facet*~"value"
```

### ends with, `~*`
Searches for labels or facets where the value ends with the specified string.

**Syntax**

```text
label~*"value"
@facet~*"value"
```

### contains, `**`
Searches for labels or facets where the value contains the specified string.

**Syntax**

```text
label**"value"
@facet**"value"
```

### key exists
Searches for the presence of a specific facet, regardless of its value.

**Syntax**

Regular search:  
```text
key exists = "facet"
```
Advanced search:  
```text
@facet
```
