# Log4Net

**URL:** <https://discuss.elastic.co/t/log4net/86476>\
**Category:** Logstash\
**Created:** [May 19, 2017, 6:03pm UTC](https://discuss.elastic.co/t/log4net/86476 "2017-05-19T18:03:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![snakpak](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@snakpak](https://discuss.elastic.co/u/snakpak)\
**Post date:** [May 19, 2017, 6:03pm UTC](https://discuss.elastic.co/t/log4net/86476/1 "2017-05-19T18:03:07Z")

</div>

Hi,  
I just installed LogStash using these steps ([https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elk-stack-on-centos-7](https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elk-stack-on-centos-7))

Now, I need to parse my log4net's logs.

I want each fields to be indexed in his own field, like Level=ERROR.

I'm using filebeat to send my log files from Windows to logstash.

I can't change my application's log4net config

Can anyone help me?

eg.  
2017-05-19 04:00:02,349 UTC ThreadID=[Worker #04c4ee00] Level=ERROR Logger=Hangfire.AutomaticRetryAttribute Failed to process the job '26934': an exception occurred.  
Hangfire.Storage.DistributedLockTimeoutException: Timeout expired. The timeout elapsed prior to obtaining a distributed lock on the 'HangFire:AzureTranslationCachingJob.Execute' resource.  
at Hangfire.SqlServer.SqlServerDistributedLock.Acquire(IDbConnection connection, String resource, TimeSpan timeout)  
at Hangfire.SqlServer.SqlServerDistributedLock..ctor(SqlServerStorage storage, String resource, TimeSpan timeout)  
at Hangfire.SqlServer.SqlServerConnection.AcquireDistributedLock(String resource, TimeSpan timeout)  
at Hangfire.DisableConcurrentExecutionAttribute.OnPerforming(PerformingContext filterContext)  
at Hangfire.Server.BackgroundJobPerformer.InvokePerformFilter(IServerFilter filter, PerformingContext preContext, Func`1 continuation)

For now, all fields is indexed in message.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [May 24, 2017, 9:23am UTC](https://discuss.elastic.co/t/log4net/86476/2 "2017-05-24T09:23:04Z")

</div>

Use a grok filter to extract fields as desired. If you're unfamiliar with regular expressions the grok constructor web site can help you get started.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 21, 2017, 9:23am UTC](https://discuss.elastic.co/t/log4net/86476/3 "2017-06-21T09:23:06Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
