我想做的等同于SQL中的HAVING子句。真实的描述是,我正在尝试查找指向两个(或更多)索引及其索引名的Elasticsearch别名。数据看起来像this。
我首先执行group by,然后旋转它们以获得行,其中第一列是组键,第二列是一个包含n行的表。获取该表的命令是open file.txt | lines | split-column " " --collapse-empty Alias Index | group by Alias | pivot
──┬───────────────┬────────────────
# │ Column0 │ Column1
───┼───────────────┼────────────────
0 │ abcd_20200430 │ [table 1 rows]
1 │ abcd_20200501 │ [table 3 rows]
2 │ abcd_20200502 │ [table 2 rows]
3 │ abcd_20200503 │ [table 1 rows]
4 │ abcd_20200504 │ [table 1 rows]我想按Column1有超过1行的行来过滤这个表。我该怎么做呢?
| where Column1.count > 1不工作
发布于 2020-05-16 12:06:33
您可以尝试添加另一个具有其大小的列作为解决办法。如下所示:
open file.txt | lines | split-column " " --collapse-empty Alias Index | group by Alias | pivot | default size 0 | update size { get Column1 | count }https://stackoverflow.com/questions/61831051
复制相似问题