Conditionally print value based on the value of another key

后端 未结 1 619
-上瘾入骨i
-上瘾入骨i 2021-01-02 17:52

Here\'s some example JSON:

{
  \"Tags\": [
    {
      \"Key\": \"Name\",
      \"Value\": \"foo\"
    },
    {
      \"Key\": \"Type\",
      \"Value\": \"C         


        
相关标签:
1条回答
  • 2021-01-02 18:07

    Try this:

    .Tags[] | select(.Key == "Type") | .Value
    
    0 讨论(0)
提交回复
热议问题