[BUG] Row 315 of UAParser.cs in Elastic.Serilog.Enrichers.Web is incorrect

Open Beginner friendly
#451 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
60/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp
Domain
backend

Research direction

Open UAParser.cs in Elastic.Serilog.Enrichers.Web and inspect row 315, starting from the resource lookup used by UAParser.Parse(stringValues). Reproduce through Enrich.WithEcsHttpsContext(IHttpContextAccessor); done means the regex resource loads correctly and parsing no longer throws a TypeInitializationException.

Written by the indexing model from the issue text.

Description

bug

ECS integration/library project(s) (e.g. Elastic.CommonSchema.Serilog):
Elastic.Serilog.Enrichers.Web

ECS schema version (e.g. 1.4.0):

ECS .NET assembly version (e.g. 1.4.2):
8.12.0

Elasticsearch version (if applicable):

.NET framework / OS:

Description of the problem, including expected versus actual behavior:
Row 315 of UAParser.cs in Elastic.Serilog.Enrichers.Web is incorrect. Right now (September 27 2024) it is:
.Assembly.GetManifestResourceStream("UAParser.regexes.yaml"))

To actually work it should be:
.Assembly.GetManifestResourceStream("Elastic.Serilog.Enrichers.Web.Lib.UAParser.regexes.yaml"))

Steps to reproduce:

  1. Use Enrich.WithEcsHttpsContext(IHttpContextAccessor)
  2. Run your solution
  3. 'UAParser.Parse(stringValues)' threw an exception of type 'System.TypeInitializationException'
Dominant language
HTML
Stars
137
Forks
70
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elastic/ecs-dotnet

All issues in elastic/ecs-dotnet

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.