Created
July 31, 2023 14:01
-
-
Save abutcher/a97274977dc37f6eb299f1b28dccac6d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import json | |
import pandas as pd | |
import sys | |
f = open(sys.argv[1]) # first arg is path to the activity json log | |
data = json.load(f) | |
f.close() | |
listt = [] | |
gotActions = [] | |
for i in data: | |
if i is not None and i['claims'] is not None and i['claims']['appid'] == sys.argv[2]: # second arg is the client id of identity | |
d={} | |
d["localizedValue"] = i['operationName']["localizedValue"] | |
value = i['operationName']["value"] | |
if value in gotActions: | |
continue | |
else: | |
gotActions.append(value) | |
d['value'] = value | |
listt.append(d) | |
print("clientId ", sys.argv[2]) | |
df = pd.DataFrame(listt) | |
if 'value' in df: | |
s=json.dumps((list(df['value']))) | |
print(s) | |
else: | |
print("no actions found") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment