Json-match - Command line util for matching values in a JSON input

json-match

Match JSON input by specifying key and value

> json-match -json '{\"person\":{\"id\":1755, \"name\":\"alexander\", \"family\":{\"spouse\": \"eliza\"}}}' -key user.family.spouse -value eliza
🟒 match
> json-match -json '{\"person\":{\"id\":1755, \"name\":\"alexander\", \"family\":{\"spouse\": \"eliza\"}}}' -key user.family.spouse -value angelica
πŸ”΄ no match
> json-match -json '{\"user\":{\"id\":1755,\"name\":\"alexander\",\"family\":{\"spouse\":\"eliza\",\"children\":[{\"id\":1782,\"name\":\"philip\"},{\"id\":1784,\"name\":\"angelica\"},{\"id\":1786,\"name\":\"alexander\"}]}}}' -key user.family.children.id -value 1782
🟒 match
> json-match -help
Usage of json-match:
  -blankVal
        Set if the filter should match on blank values
  -nullVal
        Set if the filter should match on null values
  -json string
        JSON input string
  -key string
        Key to filter on. Format: node.subnode.subsubnode
  -print
        Print json to output if match is found.
  -value string
        Key should match this value to be filtered to output.
        Use '-blankVal' if matching on empty string values.
Owner
Trond Boksasp
Infrastructure consultant turned programmer. Currently working mostly on web development.
Trond Boksasp
Similar Resources

efficient string matching in Golang via the aho-corasick algorithm.

aho-corasick Efficient string matching in Golang via the aho-corasick algorithm. x20 faster than https://github.com/cloudflare/ahocorasick and x3 fast

Dec 27, 2022

Project-1 - Create a service that accepts input as text and provides Json Output as Top ten most used words and times of occurrence in the text

Project Assignment Steps to run the project: download or clone repo in your loca

Jan 27, 2022

Go package to make lightweight ASCII line graph β•­β”ˆβ•― in command line apps with no other dependencies.

Go package to make lightweight ASCII line graph β•­β”ˆβ•― in command line apps with no other dependencies.

asciigraph Go package to make lightweight ASCII line graphs β•­β”ˆβ•―. Installation go get github.com/guptarohit/asciigraph Usage Basic graph package main

Jan 8, 2023

git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

Table of contents Introduction Reference Contributing Introduction Overview git-xargs is a command-line tool (CLI) for making updates across multiple

Dec 31, 2022

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command. You give git-xargs:

Feb 5, 2022

Package command provide simple API to create modern command-line interface

Package command Package command provide simple API to create modern command-line interface, mainly for lightweight usage, inspired by cobra Usage pack

Jan 16, 2022

A command line tool for simplified docker volume command built with go

dockervol A command line tool for simplified docker volume command built with go. Features: Remove anonymous volume (beta) Remove volume by matching n

Dec 18, 2021

Watcher - A simple command line app to watch files in a directory for changes and run a command when files change!

Watcher - Develop your programs easily Watcher watches all the files present in the directory it is run from of the directory that is specified while

Mar 27, 2022

Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.

Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.

dasel Dasel (short for data-selector) allows you to query and modify data structures using selector strings. Comparable to jq / yq, but supports JSON,

Jan 2, 2023
Idiomatic Go input parsing with subcommands, positional values, and flags at any position. No required project or package layout and no external dependencies.
Idiomatic Go input parsing with subcommands, positional values, and flags at any position. No required project or package layout and no external dependencies.

Sensible and fast command-line flag parsing with excellent support for subcommands and positional values. Flags can be at any position. Flaggy has no

Jan 1, 2023
Go cmd util that prints cmd-line args with their index

echoidx This is an exercise of the book The Go Programming Language, by Alan A.

Dec 18, 2021
A command line tool for filling missing metric values on Mackerel.

mackerel-null-bridge A command line tool for filling missing metric values on Mackerel. Description When sending error metrics, etc., you may be force

Jan 11, 2022
An open-source GitLab command line tool bringing GitLab's cool features to your command line
An open-source GitLab command line tool bringing GitLab's cool features to your command line

GLab is an open source GitLab CLI tool bringing GitLab to your terminal next to where you are already working with git and your code without switching

Dec 30, 2022
A command line tool that builds and (re)starts your web application everytime you save a Go or template fileA command line tool that builds and (re)starts your web application everytime you save a Go or template file

# Fresh Fresh is a command line tool that builds and (re)starts your web application everytime you save a Go or template file. If the web framework yo

Nov 22, 2021
A command line tool to prompt for a value to be included in another command line.

readval is a command line tool which is designed for one specific purposeβ€”to prompt for a value to be included in another command line. readval prints

Dec 22, 2021
Simple CLI util for running OCR on images through PERO OCR API

pero_ocr Simple CLI util for running OCR on images through PERO OCR API Usage: Usage of batch_pero_ocr: -c string cancel request with given

Dec 1, 2021
ets2-dlc-repacker is a Windows / Linux / MacOS CLI util to automatically repack older DLC archives for compatibility with newer versions.
ets2-dlc-repacker is a Windows / Linux / MacOS CLI util to automatically repack older DLC archives for compatibility with newer versions.

ets2-dlc-repacker is a Windows / Linux / MacOS CLI util to automatically repack older DLC archives for compatibility with newer versions.

Dec 26, 2021
espnwrapper to track real time scores for your fav match... in a terminal while working.
espnwrapper to track real time scores for your fav match... in a terminal while working.

An espncricinfo wrapper written in go to track scores in real time and in the cmd/cli you can find the Command Line Interface wrapped over this wrapper.

Mar 13, 2022
This package can parse date match expression, which used by ElasticSearch

datemath-parser this package is pure go package, this package can parse date match expression, which used by ElasticSearch. Date Math Definition you c

Jan 8, 2022