Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7042215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:08:28+00:00 2026-05-28T02:08:28+00:00

I am parsing error log files across multiple servers and need to report on

  • 0

I am parsing error log files across multiple servers and need to report on problem errors.
The error log files should contain at least the following (known errors that are OK):

  • ERROR Some error text
  • ERROR Some more error text
  • ERROR Here is more error text

What I need is a Select-String search pattern that includes all three text strings above:

$Search_Str_1 = "ERROR Some error text"
$Search_Str_2 = "ERROR Some more error text"
$Search_Str_3 = "ERROR Here is more error text"

$Search_Str_1, $Search_Str_2, and $Search_Str_3 are acceptable error strings and should not be reported if found in the error logs. However, if any additional error string is found that does not match any of the above search strings, then it should be reported as a bad error.

Example:

  • ERROR Some error text
  • ERROR Some more error text
  • ERROR Here is more error text
  • ERROR This is bad error text and should be reported

The 4th error line (and any other line that does not match search_str 1, 2, or 3) would need to be reported as bad.

Hypothetical code:

$ErrorLog = Get-ChildItem -Path $LOG_PATH -Include Error.log -Recurse | Select-String -notmatch ($Search_Str_1 -or $Search_Str_2 -or $Search_Str_3)

How would I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:08:29+00:00Added an answer on May 28, 2026 at 2:08 am

    select-string -pattern takes in an array. Put those search string in an array and pass it to the select string. Add the -NotMatch flag if you want it to not match the patterns you passed in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the Venkman JavaScript debugger for Mozilla and getting the following error: XML Parsing
My (existing) perl files creates a Log file using Log4Perl in the following format
In visual studio I get XAML parsing error when a story board is run.
When working with ActiveMQ in Eclipse, you might sometimes get a schema parsing error
I got this error An error occurred while parsing EntityName. Line 1, position 61.
I'm using Amazon's simpledb in my app. When parsing xml it gives an error
Parsing a text file in vb.net and need to locate the latitude and longitude
I`m parsing SQL query with C# Regex. I need also to make my pattern
I'm parsing text from a file and storing it in a string. The problem
Perl newbie here. I have a log file that I need to parse out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.