Skip to content

Usage Examples

zarunbal edited this page Oct 24, 2019 · 3 revisions

This page is a collection of possible examples how to use LogExpert (No guaranty that they will work) ;)

Sending Mails form LogExpert

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

grafik

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)

From issue 60

Monolog Regex for RegexColumnizer

\[(?<date>\d{4}-\d{2}-\d{2})\s(?<time>\d{2}:\d{2}:\d{2})\]\s(?<channel>.*)\.(?<severity>.*):\s(.*)\s\[(?<message>.*)\]\s\[(?<context>.*)\]

From issue 125

Clone this wiki locally