-
Notifications
You must be signed in to change notification settings - Fork 163
Usage Examples
This page is a collection of possible examples how to use LogExpert (No guaranty that they will work) ;)
Configure a "highlighting" that has a trigger.
- Options
- Highlighting and triggers...
- there you have to configure your keyword (Its possible to use Regex)
- Check the Plugin checkbox
- Click on select
- Select the "ProcessLauncher keyword plugin"
- Put the path to the executable and if needed further parameters in Parameter textbox.
- Close the "Keyword Action" Dialog with ok
- Click the "Add" button
- Close the "Hilighting and action triggers" dialog with ok.
- Wait till the search string matches and executes your executable
ProcessLauncher parameters
powershell.exe -ExecutionPolicy ByPass -File c:\folder1\email\MyScript.ps1
Example powershell script to send mail
$email = "[email protected]" $emailto = "[email protected]"
$pass = "jkl123" $smtpServer = "smtp.gmail.com"
$msg = new-object Net.Mail.MailMessage $smtp = new-object Net.Mail.SmtpClient($smtpServer) $smtp.EnableSsl = $true $msg.From = "$email" $msg.To.Add("$emailto")
$msg.BodyEncoding = [system.Text.Encoding]::UTF8 $msg.SubjectEncoding = [system.Text.Encoding]::UTF8 $msg.IsBodyHTML = $true
$msg.Subject = "It's an email Subject field" $msg.Body = "Your text here"
$SMTP.Credentials = New-Object System.Net.NetworkCredential("$email", "$pass");
$smtp.Send($msg)
\[(?<date>\d{4}-\d{2}-\d{2})\s(?<time>\d{2}:\d{2}:\d{2})\]\s(?<channel>.*)\.(?<severity>.*):\s(.*)\s\[(?<message>.*)\]\s\[(?<context>.*)\]