Jorge
Jorge

Reputation: 37

Kusto: extract unique words in text

is it possible extract unique word from column with Kusto?

Example text: an example text, an orange, text bold Get only words: an, example, text, orange, bold

I'm trying with this regex:

mytable | extend ff = extract_all(@'(\w+\b)(?!.*\1\b)', info));

Upvotes: 1

Views: 503

Answers (1)

Yoni L.
Yoni L.

Reputation: 25895

you could try this, using set_union() on top of the output of extract_all():

print input = "an example text, an orange, text bold Get only words: an, example, text, orange, bold"
| extend unique_words = set_union(dynamic(null), extract_all(@"(\w+)", input))
input unique_words
an example text, an orange, text bold Get only words: an, example, text, orange, bold [
"an",
"example",
"text",
"orange",
"bold",
"Get",
"only",
"words"
]

Upvotes: 2

Related Questions