Log in
Hot & Trending on FMT

FileMaker Server Tip Summarizing Server Access.log data

Featured FileMaker Server Tip Summarizing Server Access.log data

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 users had accessed databases when using largely 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
…

A more typical situation here where we want to summarize which accounts are accessing the databases:

grep "opening database" "/Library/FileMaker Server/Logs/Access.log" | grep -v "(FileMaker Script)" | tr "\"[]" "\t" | cut -f12,10 | LC_ALL=C sort -f | uniq -i | expand -t50,90
checkIt                                   Admin
PAMS                                      alex
hub_v0                                    Admin
Crew                                      developer
Crew                                      entry

Finally, a nice summary of the total times each file has been accessed (does not included files never accessed):

grep "opening database" "/Library/FileMaker Server/Logs/Access.log" | grep -v "(FileMaker Script)" | cut -d "\"" -f4 | sort | uniq -c
 690 Finance
  42 MarCom Training
 100 Licensing Tracks
  19 jam-potts
1446 Projects
1584 WW Adv

If you want tab delimited data, just drop the expand command that’s at end. The date range used depends on what’s in your Access.log file. You might want to add a head, tail or yet another grep command to get a particular range.

Beezwax

We're happy to schedule a free one hour conversation with you to discuss your FileMaker development needs. Contact us on the web, or give us a call at (888) 835-4483 - we'd love to talk.

Website: https://beezwax.net