|
|
|
@ -23,19 +23,22 @@ for record in data["Records"]: |
|
|
|
cmd_count[record["firstWord"]] += 1 |
|
|
|
cmd_count[record["firstWord"]] += 1 |
|
|
|
cmdLine_count[record["cmdLine"]] += 1 |
|
|
|
cmdLine_count[record["cmdLine"]] += 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmdTmp = sorted(cmd_count.items(), key=lambda x: x[1], reverse=True)[:50] |
|
|
|
|
|
|
|
cmdFrq = list(map(lambda x: x[1] / cmdTmp[0][1], cmdTmp)) |
|
|
|
|
|
|
|
|
|
|
|
cmdFrq = list(map(lambda x: x[1] / len(data["Records"]), sorted(cmd_count.items(), key=lambda x: x[1], reverse=True))) |
|
|
|
cmdLineTmp = sorted(cmdLine_count.items(), key=lambda x: x[1], reverse=True)[:50] |
|
|
|
cmdLineFrq = list(map(lambda x: x[1] / len(data["Records"]), sorted(cmdLine_count.items(), key=lambda x: x[1], reverse=True))) |
|
|
|
cmdLineFrq = list(map(lambda x: x[1] / cmdLineTmp[0][1], cmdLineTmp)) |
|
|
|
|
|
|
|
|
|
|
|
print(cmdFrq) |
|
|
|
print(cmdFrq) |
|
|
|
print("#################") |
|
|
|
print("#################") |
|
|
|
#print(cmdLineFrq_rank) |
|
|
|
#print(cmdLineFrq_rank) |
|
|
|
|
|
|
|
|
|
|
|
plt.plot(range(1, len(cmdFrq)+1), cmdFrq) |
|
|
|
plt.plot(range(1, len(cmdFrq)+1), cmdFrq, 'o-') |
|
|
|
plt.title("Command frequency") |
|
|
|
plt.title("Command frequency") |
|
|
|
|
|
|
|
plt.yticks() |
|
|
|
#plt.xticks(range(1, len(cmdFrq)+1)) |
|
|
|
#plt.xticks(range(1, len(cmdFrq)+1)) |
|
|
|
plt.show() |
|
|
|
plt.show() |
|
|
|
|
|
|
|
|
|
|
|
plt.plot(range(1, len(cmdLineFrq)+1), cmdLineFrq) |
|
|
|
plt.plot(range(1, len(cmdLineFrq)+1), cmdLineFrq, 'o-') |
|
|
|
plt.title("Commandline frequency") |
|
|
|
plt.title("Commandline frequency") |
|
|
|
plt.show() |
|
|
|
plt.show() |