脚本:
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28  | 
						#!/bin/env php <?php $filter = isset($argv[1])?$argv[1]:""; $arr = explode(".", $filter); while(!feof(STDIN)) { 	$line = trim(fgets(STDIN)); 	if (!$line) continue; 	$result = array(); 	parse_str($line, $result); 	$notFound = false; 	foreach($arr as $key) { 		if ($key == "") continue; 		if (!isset($result[$key])) { 			$notFound = true; 			break; 		} 		$result = $result[$key]; 	} 	if ($notFound) continue; 	if (is_array($result)) { 		print_r($result); 		echo "\n"; 		continue; 	} 	if (is_string($result)) { 		echo "$result\n"; 	} }  | 
					
受jq的启发
这个parser很奇怪, 处理的是 value 嵌套value的情况,生产上有这种情况,但是很少见。