Skip to content

Instantly share code, notes, and snippets.

@abutcher
Created July 31, 2023 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abutcher/a97274977dc37f6eb299f1b28dccac6d to your computer and use it in GitHub Desktop.
Save abutcher/a97274977dc37f6eb299f1b28dccac6d to your computer and use it in GitHub Desktop.
#!/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