Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

Powershell script for report on logs within a specific time window?

$
0
0

Howdy (again),

I am working on a process to automate a tedious function that currently involves:

1.  Taking log files from a specific directory on a server and that were modified or created within a 6 hour window.

2.  Copying them to a new directory, before copying them empty the directory contents.

3.  Uncompressing them because they are .gz files

4.  Then running a perl script that an application support team provided against the log files.

5.  Once that is done a file is created with the results of the perl script which shows specific details on errors in the log files.

6.  Then I have to email the report out that is created within that file.  

I think I have the email part OK with importing the file and converting to html or excel, ideally I would like to highlight certain lines in the report, but I'm not sure how complicated that will be?

But how can I at least get powershell to take the files from the log directory, empty the destination directory (delete without going to recycle bin), then copy the files, uncompress these gz files, then launch the perl script and  finally send the email?  The file that is output when the perl script runs is a .txt file.

I know this is quite a bit to ask for help with, but I'm learning so I really appreciate the assistance because I'm definitely making progress doing some other things I've learned on here, but it's these things where I'm not sure how to start and then get to the end part.

Thank you all in advance!
Jake 


Viewing all articles
Browse latest Browse all 8583

Trending Articles