diff --git a/TimberWinR.ServiceHost/Properties/AssemblyInfo.cs b/TimberWinR.ServiceHost/Properties/AssemblyInfo.cs index 6c0118f..cea65e4 100644 --- a/TimberWinR.ServiceHost/Properties/AssemblyInfo.cs +++ b/TimberWinR.ServiceHost/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.4.0")] -[assembly: AssemblyFileVersion("1.3.4.0")] +[assembly: AssemblyVersion("1.3.5.0")] +[assembly: AssemblyFileVersion("1.3.5.0")] diff --git a/TimberWinR/Diagnostics/Diagnostics.cs b/TimberWinR/Diagnostics/Diagnostics.cs index e3f1d78..9596429 100644 --- a/TimberWinR/Diagnostics/Diagnostics.cs +++ b/TimberWinR/Diagnostics/Diagnostics.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using System.Runtime.Remoting.Messaging; using System.Text; using System.Threading; @@ -41,6 +42,13 @@ namespace TimberWinR.Diagnostics result.AsyncWaitHandle.WaitOne(); } + private Assembly GetAssemblyByName(string name) + { + return AppDomain.CurrentDomain.GetAssemblies(). + SingleOrDefault(assembly => assembly.GetName().Name == name); + } + + private void DiagnosticCallback(IAsyncResult result) { if (web == null) @@ -52,6 +60,7 @@ namespace TimberWinR.Diagnostics JObject json = new JObject( new JProperty("timberwinr", new JObject( + new JProperty("version", GetAssemblyByName("TimberWinR.ServiceHost").GetName().Version.ToString()), new JProperty("messages", Manager.NumMessages), new JProperty("startedon", Manager.StartedOn), new JProperty("configfile", Manager.JsonConfig), diff --git a/TimberWinR/Filters/GrokFilter.cs b/TimberWinR/Filters/GrokFilter.cs index f0b3796..944d3e5 100644 --- a/TimberWinR/Filters/GrokFilter.cs +++ b/TimberWinR/Filters/GrokFilter.cs @@ -36,9 +36,14 @@ namespace TimberWinR.Parser { public override JObject ToJson() { + string field = Match[0]; + string expr = Match[1]; + JObject json = new JObject( new JProperty("grok", new JObject( + new JProperty("match", field), + new JProperty("expr", expr), new JProperty("condition", Condition), new JProperty("addfields", AddField), new JProperty("addtags", AddTag), diff --git a/TimberWinR/Inputs/LogsListener.cs b/TimberWinR/Inputs/LogsListener.cs index ed9eec1..30fd791 100644 --- a/TimberWinR/Inputs/LogsListener.cs +++ b/TimberWinR/Inputs/LogsListener.cs @@ -79,10 +79,7 @@ namespace TimberWinR.Inputs try { Thread.CurrentThread.Priority = ThreadPriority.BelowNormal; - FileInfo fiw = new FileInfo(fileToWatch); - if (!fiw.Exists) - continue; - + var qfiles = string.Format("SELECT Distinct [LogFilename] FROM {0}", fileToWatch); var rsfiles = oLogQuery.Execute(qfiles, iFmt); for (; !rsfiles.atEnd(); rsfiles.moveNext()) @@ -90,6 +87,7 @@ namespace TimberWinR.Inputs var record = rsfiles.getRecord(); string logName = record.getValue("LogFilename") as string; FileInfo fi = new FileInfo(logName); + fi.Refresh(); DateTime creationTime = fi.CreationTimeUtc; bool logHasRolled = logFileCreationTimes.ContainsKey(logName) && creationTime > logFileCreationTimes[logName];