How can i parse the AnyConnect.txt logfile (is a part of the Dart File)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2017 04:33 AM
Hi all, i have problems with reading the AnyConnect.txt log file, i need a parser for my log file viewer (GamutLogViewer).
The Windows Eventlog Viewer (AnyConnect.evtx) is not a good tool for me to read this file, this is the reason for me to read the *.txt file with my LogFileViewer, but i have no parser for it. Any other logfile that i analyse have seperated columns for date, time, process, message, .... so it makes it easier for me to read them in my viewer.

Example
Date : 06/22/2017
Time : 08:24:24
Type : Information
Source : acvpnui
Description : Function: ConnectMgr::processCSDData
File: ConnectMgr.cpp
Line: 3533
CSD detected, launching CSD.
******************************************
Date : 06/22/2017
Time : 08:24:24
Type : Information
Source : acvpnui
Description : Message type information sent to the user:
Posture Assessment: Required for access
******************************************
Date : 06/22/2017
Time : 08:24:24
Type : Information
Source : acvpnui
Description : Function: ConnectMgr::launchCSDStub
File: ConnectMgr.cpp
Line: 7567
Gathering CSD version information.
******************************************
- Labels:
-
Remote Access
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2021 04:25 AM - edited 04-15-2021 04:27 AM
You can convert the txt file to the Microsoft Excel file by Python.
sample code is here:
f = r'<your path>\Cisco AnyConnect Secure Mobility Client\AnyConnect.txt'
import re,datetime, os
import pandas as pd
pd.DataFrame([[
{
'Datetime': datetime.datetime.strptime(Date+' '+Time,'%m/%d/%Y %H:%M:%S'),
'Type': Type,
'Source': Source,
'Description': Description
}
for Date,Time,Type,Source,Description in
re.findall(r'Date +: (.+)\n+Time +: (.+)\n+Type +: (.+)\n+Source +: (.+)\n+Description +: ((?:.|\s)+)',d)][0]
for d in open(f).read().split('\n******************************************\n')[:-1]]).to_excel(
os.path.join(os.path.dirname(f),'AnyConnect.xlsx'),index=False)