If i understand the description correctly, this could work.
It:
- splits the original comma separated string using
split()
- expands those using
mv-apply
- filters out values that don't contain
win
- aggregates the remaining values into a new (filtered) comma separated string
datatable(Computers:string, id:int)
[
"window432, linus909, windows322, linux432", 1,
"window451, linux459, windows444, linux234", 2,
"android222, ios222, linux333" , 3
]
| mv-apply Computer = split(Computers, ", ") on (
where Computer contains "win"
| summarize Computers = strcat_array(make_list(Computer), ", ")
)
| where isnotempty(Computers)
input:
| Computers | id |
|-------------------------------------------|----|
| window432, linus909, windows322, linux432 | 1 |
| window451, linux459, windows444, linux234 | 2 |
| android222, ios222, linux333 | 3 |
output:
| id | Computers |
|----|-----------------------|
| 1 | window432, windows322 |
| 2 | window451, windows444 |
datatable
operator) and its matching expected output. specifically - do you want the output to include the entire value ofComputer
, or only the entries in it that have thewin
substring - as a single record? as multiple records? – Yoni L.