Summarizing FileMaker Server Access.log data

 

Today's excerpt takes us back to the the Command Line Interface (CLI) and to shell commands.  Simon at Beezwax gives us three  shell commands that allow us to grab and format data from the FileMaker Server access log.  The reports show user and database information:

Various times I’ve needed to do some quick summaries of how a given server and its databases were being used. When using Mac OS, I may use shell commands to get a quick summary of what’s happening on a particular server.

Here’s one that came up just recently. Client wanted to know what accounts had been used to access databases, but they were largely using generic account names.

grep "opening database" "/Library/FileMaker Server/Logs/Access.log" | grep -v "(FileMaker Script)" | tr "\"[]" "\t" | cut -f6,10,12 | LC_ALL=C sort --ignore-case | uniq -i | expand -t50,90,110
…
Enriqoa da le Hoalge (Enriqoa’s Macbook)        pappar-putts                   Enriqoa da le Hoalge
Enriqoa Girun (Enriqoa Girun's Air)             vurld vida rertnar             Enriqoa Girun
Enriqoa Girun-Gotiarraz (mutaedfinenca)         vurld vida Data                Enriqoa Girun
Erice Oessenu (Erice oessenu)                   Go Finenca                     rm
Erice Oessenu (Erice oessenu)                   rrujacts                       rm
Erice Heims (Erice Heims' Macbook)              pappar-putts                   Erice Heims
Eone Kwun (Eone Kwun's macbook)                 pappar-putts                   Eone Kwun
…

Obviously, this is not for the faint of heart.  My biggest problem with shell commands is that I don't use them enough to remember them.  Fortunately, the internet does remember.

To use shell commands on a Mac running FileMaker server, you will need to open the Terminal program.  You'll see a window similar to this (although it will most likely be a black background.  I changed mine):


Terminal Window Example

 

Thanks to Simon, you can copy his commands directly from his post and paste them into the window:

Grep command

Enter return, and the results from your log will appear.  Next, copy and paste the output to a word processor or an email program to share.

FYI:  FileMaker also has a complete set of CLI commands you can use to control the server:  Start, stop, etc.  Check them out when you have time.  If the FileMaker Server Admin window won't open, this is your alternate way to access the server. Enjoy!

 

Summarizing FileMaker Server Access.log data | the beezwax buzz.

Thanks! You've already liked this
Need FileMaker Development Help? Or to purchase FileMaker Software?
Contact FM Pro Gurus for help