Carlo-Giuliani
asked on
A way to import/parse this Astaro firewall log format (ulogd) into an Excel workbook
I am trying analyze a log file from an Astaro firewall. I'd like to do it in Excel but the log file format makes it hard to import into Excel in a useable way.
Below is one (shortened) line from a log file, and I have attached sample file containing 3 complete records.
Do somebody know any easy way to parse this into a more useable format for Excel?
2012:06:29-00:00:04 69-2 ulogd[6094]: id="2001" severity="info" sys="SecureNet" sub="packetfilter" name="Packet dropped" action="drop"
sample.txt
Below is one (shortened) line from a log file, and I have attached sample file containing 3 complete records.
Do somebody know any easy way to parse this into a more useable format for Excel?
2012:06:29-00:00:04 69-2 ulogd[6094]: id="2001" severity="info" sys="SecureNet" sub="packetfilter" name="Packet dropped" action="drop"
sample.txt
ASKER
Wow, i wasn't expecting somebody to write code for this!
I'm not familiar with Excel automation and am not sure how to use this code. First I tried to save it as a .vbs file but got a compilation error...looks this is VBA?? I then groped my way through the process of enabling the developer tab in Excel, importing the code as a module, and ran the code from there. Success! It works (with some minor problems I think I can figure out myself.).
But perhaps you can explain to me how to better use the code?? I'm going to accept this as solution one way or the other, but understanding how best to use the code makes the difference between rating the solution as "good" or "excellent"
I'm not familiar with Excel automation and am not sure how to use this code. First I tried to save it as a .vbs file but got a compilation error...looks this is VBA?? I then groped my way through the process of enabling the developer tab in Excel, importing the code as a module, and ran the code from there. Success! It works (with some minor problems I think I can figure out myself.).
But perhaps you can explain to me how to better use the code?? I'm going to accept this as solution one way or the other, but understanding how best to use the code makes the difference between rating the solution as "good" or "excellent"
Carlo-Giuliani,
Just press the blue "Astaro_Log" button in the file. This then prompts you for the log file.
Regards,
Brian.
Just press the blue "Astaro_Log" button in the file. This then prompts you for the log file.
Regards,
Brian.
ASKER
I don't see any such button. Where should I be looking?
Carlo-Giuliani,
Please see attached. What do you see when you open the spreadsheet?
Regards,
Brian.
Astaro-Log.jpg
Please see attached. What do you see when you open the spreadsheet?
Regards,
Brian.
Astaro-Log.jpg
ASKER
All I see is the data. To get to the macro I have to go to the developer toolbar and select "Macros".
Can you spell out for me what you expected me to do with the code?
What I actually did was:
- Saved the code in a .vbs file (wrong, I now know..)
- Opened Excel (default new, empty, workbook)
- File...Options...enabled Developer toolbar
- On developer toolbar, selected "Visual Basic"
- Selected file...import....imported the .vbs file that I had created
- back to developer toolbar, selected "Macros"
- selected "Astaro_Log" and "Run"
This works, but I have the feeling I am doing things the hard way....
Can you spell out for me what you expected me to do with the code?
What I actually did was:
- Saved the code in a .vbs file (wrong, I now know..)
- Opened Excel (default new, empty, workbook)
- File...Options...enabled Developer toolbar
- On developer toolbar, selected "Visual Basic"
- Selected file...import....imported the .vbs file that I had created
- back to developer toolbar, selected "Macros"
- selected "Astaro_Log" and "Run"
This works, but I have the feeling I am doing things the hard way....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks, Carlo-Giuliani.
Please see attached. A warning - there's very little intelligence in the macro so that it will have problems if the file layout is even slightly different or there are embedded double-quotes.
The code is
Open in new window
Regards,Brian.Astaro-Log.xlsm