Reputation: 31550
Is there a way to have IIS not log all requests but just a percentage? I ship IIS request logs and I only want a sample of them. I could do this further down in the log processing pipeline (which is what I'm doing now) but was curious if IIS can do this- because that would be simpler for me.
Can you just tell IIS to only log 2% of requests or just log every 200th request or something like that?
Upvotes: 1
Views: 176
Reputation: 3624
IIS itself will not do this and I'd avoid any attempt to try and force it to do so or it will come back to haunt you.
If you really had to do it on the server where iis is installed you could use a scheduled task and powershell script to create the samples of the log files then ship the filtered logs. But it's getting messy and is something else to maintain so it depends if it's worth it given your specific requirements/constraints.
Bottom line unless a really strong case existed to slim the data down before injestion i would keep your sampling within your log shipping pipeline.
You didn't say how your shipping the logs so worth looking if your using an agent can it sample the data locally so you can avoid the wasted bandwidth, other systems do it server side so all data is shipped.
Upvotes: 1