Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with Eventviewer log

Using below:

$pattern = 'Unable to create Load Balance Manager object!'
$events = Get-WinEvent -ea SilentlyContinue `
-ProviderName "Hyperion Financial Data Quality Management - Task Manager Service"|
Where-Object { $_.TimeCreated -gt [datetime]::now.AddMinutes(-15) -and $_.Message -match $pattern }
$events   >> G:\Sysadmin\FDMmonitor\Error.txt  

I'm getting Error.txt as below:

TimeCreated         ProviderName                         Id Message            
-----------         ------------                         -- -------            
1/24/2014 11:41:... Hyperion Financi...                   0 Unable to create...
1/24/2014 11:41:... Hyperion Financi...                   0 Unable to create...
1/24/2014 11:41:... Hyperion Financi...                   0 Unable to create...
1/24/2014 11:40:... Hyperion Financi...                   0 Unable to create...
1/24/2014 11:39:... Hyperion Financi...                   0 Unable to create...
1/24/2014 11:39:... Hyperion Financi...                   0 Unable to create...
1/24/2014 11:39:... Hyperion Financi...                   0 Unable to create...
1/24/2014 11:39:... Hyperion Financi...                   0 Unable to create...
1/24/2014 11:38:... Hyperion Financi...                   0 Unable to create...
1/24/2014 11:37:... Hyperion Financi...                   0 Unable to create...
1/24/2014 11:37:... Hyperion Financi...                   0 Unable to create...
1/24/2014 11:37:... Hyperion Financi...                   0 Unable to create...
1/24/2014 11:36:... Hyperion Financi...                   0 Unable to create...
1/24/2014 11:36:... Hyperion Financi...                   0 Unable to create...

I'm not getting, why TimeCreated, ProviderName and Message are not coming with full text ?

What I need to change in my code to get some more text for these columns ?

like image 508
Sunny Avatar asked Jan 22 '26 09:01

Sunny


2 Answers

If you want to get the results as you see them on the screen without anything shortened, you might try changing your code like this:

 $events = Get-WinEvent -ea SilentlyContinue `
-ProviderName "Hyperion Financial Data Quality Management - Task Manager Service"|
Where-Object { $_.TimeCreated -gt [datetime]::now.AddMinutes(-15) -and $_.Message -match $pattern }
$events |format-table -AutoSize |out-file -append -encoding Ascii G:\Sysadmin\FDMmonitor\Error.txt -width 300
like image 197
Adil Hindistan Avatar answered Jan 25 '26 18:01

Adil Hindistan


Could it be that you are not in the USA? I ask because I am in the UK and I find that the Get-WinEvent log benefits from this addition, or preamble:

[System.Threading.Thread]::CurrentThread.CurrentCulture = `
New-Object "System.Globalization.CultureInfo" "en-US"
like image 34
Guy Thomas Avatar answered Jan 25 '26 18:01

Guy Thomas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!