<commit_before>#!/usr/local/bin/zsh
device=$1
logs=`cat currenttraffic.log`
json=`echo $logs | jq  -c '.[]'`
json1=`echo $json | jq -c '.[]'`
devstats=`echo $json1 | grep $device`
echo $devstats<commit_msg>search scripts<commit_after>#!/usr/local/bin/zsh
device=$1
oper=$2
logs=`cat currenttraffic.log`
json=`echo $logs | jq  -c '.[]'`
json1=`echo $json | jq -c '.[]'`
devstats=`echo $json1 | grep $device`
end=`echo $devstats | sed "s/]}/]},$oper/"`
add=`echo $end`
pre=`echo $json1 | grep -v $device`
json2=`echo "{\"device\":["$pre"\n"$add| tr "\n" ","|sed 's/,$/]}/'`
echo "=================== search =================="
echo $devstats
echo "===================== add ==================="
echo $add
echo "===================== collect ==================="
echo $json2
{'fraction_non_alphanumeric': 0.35797665369649806, 'fraction_numerical': 0.01297016861219196, 'mean_word_length': 5.831858407079646, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '104290', 'n_tokens_mistral': 303, 'n_tokens_neox': 277, 'n_words': 64}