首页 > 解决方案 > 在 splunk 中将国旗表情符号注释到 3166 个国家/地区代码

问题描述

给定一堆countrycode/percent结果,用每个国家的国旗装饰一个饼图。

标签: splunksplunk-query

解决方案


splunk 中似乎还没有为此内置任何东西,但这是我构建我方法,基于已经有大写countrycode输入,如US, DE,AU等,供我自己将来参考:

… | eval flag = printf("%c%c", 127452 + tonumber(substr(countrycode,1,1), 36),
                               127452 + tonumber(substr(countrycode,2,1), 36)),
         country=countrycode+" ("+percent+"%) "+flag
splunk中的国家代码饼图

推荐阅读