Marusyk / grok.net

.NET implementation of the grok 📝
MIT License
287 stars 55 forks source link

Output json doesn't work in PowerShell #81

Open Marusyk opened 2 months ago

Marusyk commented 2 months ago

The code

 grok -p "C:\Users\RomanMarusyk\Desktop\warn.txt" -g ": warning %{WORD:code}" -o json

or inline

grok -i "2024-06-27T10:58:32.4530837Z ##[warning]/src/DatabaseSeeding/DatabaseSeeding/Data/Seeding/SeedTestData.cs(410,65): warning CA5394: Random is an insecure random number generator. Use cryptographically secure random number generators when randomness is required for security. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca5394)" -g ": warning %{WORD:code}: " -o json

Error:

grok : Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. At line:1 char:1

  • grok -i "2024-06-27T10:58:32.4530837Z ##[warning]/src/DS.DatabaseSeed ...
  • 
    + CategoryInfo          : NotSpecified: (:) [Get-Grok], FileNotFoundException
    + FullyQualifiedErrorId : System.IO.FileNotFoundException,GrokNet.PowerShell.GrokCmdlet