Prefacing this with being a complete Clojure novice, my question is more 
about approach than the actual code required. Like many, I have a few tried 
and true examples that I like to work through in each language. In my case, 
I have a set of IIS log files that I want to generate usage statistics on. 
The hitch in my particular problem is that the log files may or may not 
have columns redefined within the file.

As an example 
#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2011-05-02 17:42:15
#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2011-05-02 17:42:15
#Fields: date time c-ip cs-username s-ip s-port cs-method cs-uri-stem 
cs-uri-query sc-status cs(User-Agent)
2011-05-02 17:42:15 172.22.255.255 - 172.30.255.255 80 GET 
/images/picture2.jpg - 200 
Mozilla/4.0+(compatible;MSIE+5.5;+Windows+2000+Server)
2011-05-02 17:43:15 172.22.255.255 - 172.30.255.255 80 GET 
/images/picture1.jpg - 200 
Mozilla/4.0+(compatible;MSIE+5.5;+Windows+2000+Server)
.
.
<many more lines>
.
.
#Same file, s-ip is now removed so ordinal positions are changed
#Fields: date time c-ip cs-username s-port cs-method cs-uri-stem 
cs-uri-query sc-status cs(User-Agent)
2011-05-02 17:48:15 172.22.255.255 - 80 GET /images/picture1.jpg - 200 
Mozilla/4.0+(compatible;MSIE+5.5;+Windows+2000+Server)
2011-05-02 17:49:15 172.22.255.255 - 80 GET /images/picture3.jpg - 200 
Mozilla/4.0+(compatible;MSIE+5.5;+Windows+2000+Server)

So with the above data, I am trying to get the count of log file hits from 
a given cs(User-Agent). In other languages, I would just read in the 
#Fields row and continue processing merrily given the most recent order I 
encountered moving through the file sequentially. With Clojure, the 
immutability of the fields is throwing a wrench for me.

If anyone could give me a nudge in the right direction, I would appreciate 
it.
Cliff

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to