diff --git a/Python/INFLUXDBmthrd.py b/Python/INFLUXDBmthrd.py index 8689f37..764078c 100644 --- a/Python/INFLUXDBmthrd.py +++ b/Python/INFLUXDBmthrd.py @@ -87,6 +87,7 @@ def process_flow(i, entry): .field("dstMask", inEntry["DST_MASK"]) .field("dstCntr", ermWhatTheCountry(str(inEntry["IPV4_DST_ADDR"]))) .field("srcCntr", ermWhatTheCountry(str(inEntry["IPV4_SRC_ADDR"]))) + .tag("ISP", ermWhatTheISP(str(inEntry["IPV4_SRC_ADDR"]))) ) print("----------------") diff --git a/Python/IP2Loc.py b/Python/IP2Loc.py index a48891e..64d587f 100644 --- a/Python/IP2Loc.py +++ b/Python/IP2Loc.py @@ -14,5 +14,15 @@ def ermWhatTheCountry(inpIpAddress: Annotated[str, "Some IP address that ya want except Exception as errrrrr: return f"Error: {errrrrr}" +def ermWhatTheISP(inpIpAddress: Annotated[str, "Some IP address that ya want to get ISP for"]): + try: + skibidi = ip2loc_db.get_all(inpIpAddress) + + #return rec.country_long # Full country name, e.g. "Sweden" + return skibidi.isp + + except Exception as errrrrr: + return f"Error: {errrrrr}" + #print(ermWhatTheCountry("65.109.142.32"))