Need Relavance for read the line of content

Hi,

I have a text file with below content,

2017-06-22 18:31:57:912 1012 250 Report REPORT EVENT: {E8AD290A-3B57-41D4-B28D-91F1D8AA8782} 2017-06-22 18:31:52:912+0530 1 183 101 {6BA7607C-A3B5-4EA0-B42F-1446866C850E} 501 0 wusa Success Content Install Installation Successful: Windows successfully installed the following update: Security Update for Windows (KB4022722)
2017-07-20 19:02:33:329 1004 1354 Report REPORT EVENT: {27135FD4-8D96-471C-8E10-88B1E5B2578F} 2017-07-20 19:02:28:532+0530 1 183 101 {A4F5E70C-2538-4E65-9024-5E3C859FDA00} 501 0 wusa Success Content Install Installation Successful: Windows successfully installed the following update: Security Update for Windows (KB4025341)
2017-06-22 18:32:36:765 1012 1210 AU ########### AU: Initializing Automatic Updates ###########
2017-06-22 18:32:36:765 1012 1210 AU AU setting next sqm report timeout to 2017-06-22 13:02:36
2017-06-22 18:32:36:765 1012 1210 AU # AU disabled through User preference
2017-06-22 18:32:36:765 1012 1210 AU Initializing featured updates
2017-06-22 18:32:36:765 1012 1210 AU Found 0 cached featured updates
2017-06-22 18:32:36:765 1012 1210 AU Successfully wrote event for AU health state:0
2017-06-22 18:32:36:765 1012 1210 AU Successfully wrote event for AU health state:0
2017-06-22 18:32:36:765 1012 1210 AU AU finished delayed initialization
2017-06-22 18:32:36:765 1012 1210 AU AU setting next sqm report timeout to 2017-06-23 13:02:36
2017-07-19 01:18:01:921 644 a34 Misc =========== Logging initialized (build: 7.6.7601.23806, tz: +0530) ===========
2017-07-19 01:18:01:921 644 a34 Misc = Process: C:\Windows\SysWOW64\wusa.exe
2017-07-19 01:18:01:921 644 a34 Misc = Module: C:\Windows\SysWOW64\wuapi.dll
2017-07-19 01:18:01:921 644 a34 COMAPI ----------- COMAPI: IUpdateServiceManager::AddScanPackageService -----------
2017-07-19 01:18:01:921 644 a34 COMAPI - ServiceName = Windows Update Standalone Installer
2017-07-19 01:18:01:921 644 a34 COMAPI - ScanFileLocation = C:\6a431e9238f7b466cee872\wsusscan.cab
2017-07-19 01:18:01:968 212 1294 Misc =========== Logging initialized (build: 7.6.7601.23806, tz: +0530) ===========
2017-07-19 01:18:01:968 212 1294 Misc = Process: C:\Windows\system32\svchost.exe
2017-07-19 01:18:01:968 212 1294 Misc = Module: c:\windows\system32\wuaueng.dll
2017-07-19 01:18:01:968 212 1294 Service *************
2017-07-19 01:18:01:968 212 1294 Service ** START ** Service: Service startup
2017-07-19 01:18:01:968 212 1294 Service *********
2017-07-19 01:18:02:000 212 1294 Agent * WU client version 7.6.7601.23806
2017-07-19 01:18:02:000 212 1294 Agent * Base directory: C:\Windows\SoftwareDistribution
2017-07-19 01:18:02:000 212 1294 Agent * Access type: No proxy
2017-07-19 01:18:02:015 212 1294 Agent * Network state: Connected
2017-07-19 01:18:02:171 212 620 Report CWERReporter::Init succeeded
2017-07-19 01:18:02:171 212 620 Agent *********** Agent: Initializing Windows Update Agent ***********
2017-07-19 01:18:02:171 212 620 Agent * Prerequisite roots succeeded.
2017-07-19 01:18:02:171 212 620 Agent *********** Agent: Initializing global settings cache ***********
2017-07-19 01:18:02:171 212 620 Agent * WSUS server:
2017-07-20 19:02:31:485 5000 139c COMAPI -------------
2017-07-20 19:02:31:485 5000 1398 COMAPI ----------- COMAPI: IUpdateServiceManager::RemoveService -----------
2017-07-20 19:02:31:485 5000 1398 COMAPI - ServiceId = {2a506204-22d7-4682-8e82-978694d3d4fd}
2017-07-20 19:02:31:547 5000 1398 COMAPI IUpdateService removing volatile scan package service, serviceID = {2A506204-22D7-4682-8E82-978694D3D4FD}
2017-07-20 19:02:31:547 1004 2a0 Agent WARNING: WU client fails CClientCallRecorder::RemoveService with error 0x80248014
2017-07-20 19:02:31:547 5000 1398 COMAPI WARNING: ISusInternal::RemoveService failed, hr=80248014
2017-06-22 18:31:57:912 1012 250 Report REPORT EVENT: {E8AD290A-3B57-41D4-B28D-91F1D8AA8782} 2017-06-22 18:31:52:912+0530 1 183 101 {6BA7607C-A3B5-4EA0-B42F-1446866C850E} 501 0 wusa Success Content Install Installation Successful: Windows successfully installed the following update: Security Update for Windows (KB4022722)
2017-06-22 18:31:57:912 1012 250 Report REPORT EVENT: {E8AD290A-3B57-41D4-B28D-91F1D8AA8782} 2017-06-22 18:31:52:912+0530 1 183 101 {6BA7607C-A3B5-4EA0-B42F-1446866C850E} 501 0 wusa Success Content Install Installation Successful: Windows successfully installed the following update: Security Update for Windows (KB4022722)
2017-07-20 19:03:12:282 1004 12c8 AU ########### AU: Initializing Automatic Updates ###########
2017-07-20 19:03:12:282 1004 12c8 AU AU setting next sqm report timeout to 2017-07-20 13:33:12
2017-07-20 19:03:12:282 1004 12c8 AU # AU disabled through User preference
2017-07-20 19:03:12:282 1004 12c8 AU Initializing featured updates
2017-07-20 19:03:12:282 1004 12c8 AU Found 0 cached featured updates
2017-07-20 19:03:12:282 1004 12c8 AU Successfully wrote event for AU health state:0
2017-07-20 19:03:12:282 1004 12c8 AU Successfully wrote event for AU health state:0
2017-07-20 19:03:12:282 1004 12c8 AU AU finished delayed initialization
2017-07-20 19:03:12:282 1004 12c8 AU AU setting next sqm report timeout to 2017-07-21 13:33:12

In that file if possible to find the value like “Installation Successful” line entry,

for example the above txt file the following entry there,

  1. 2017-05-19 19:10:23:840 300 f50 Report REPORT EVENT: {88D4B6FE-E423-4188-8086-9016FE8DBAAA} 2017-05-19 19:10:19:118+0530 1 183 101 {9DE2A567-7C92-403D-93BE-A98BDA220F83} 501 0 wusa Success Content Install Installation Successful: Windows successfully installed the following update: Security Update for Windows (KB4018271)

  2. 2017-07-20 19:02:33:329 1004 1354 Report REPORT EVENT: {27135FD4-8D96-471C-8E10-88B1E5B2578F} 2017-07-20 19:02:28:532+0530 1 183 101 {A4F5E70C-2538-4E65-9024-5E3C859FDA00} 501 0 wusa Success Content Install Installation Successful: Windows successfully installed the following update: Security Update for Windows (KB4025341)

  3. 2017-06-22 18:31:57:912 1012 250 Report REPORT EVENT: {E8AD290A-3B57-41D4-B28D-91F1D8AA8782} 2017-06-22 18:31:52:912+0530 1 183 101 {6BA7607C-A3B5-4EA0-B42F-1446866C850E} 501 0 wusa Success Content Install Installation Successful: Windows successfully installed the following update: Security Update for Windows (KB4022722)

So result would be need like " **2017-06-22 18:31:57:912 ** " based on txt file only last entry (3) Installation Successful

Is it possible to get the result using relevance ?

Thanks,
Nagaraj

(lines of file “filename.txt”) whose (it contains “Installation Successful”)

Something like that? and if you want to trim it further, there are multiple ways to actually do it.

1 Like

And if it helps, you can write it this way so humans understand it more :slight_smile: if you read relevance a lot

lines whose(it contains "Installation Successful") of file "filename.txt"
2 Likes

Thanks @AlanM and @techadmin
I can get the below result

for the result I need only time and date marked column,

Could you please share the relevance for the same ,

Try something like the following:

(preceding text of first "%09" of it & " " & preceding text of first "%09" of following text of first "%09" of it) of lines whose(it contains "Installation Successful") of file "filename.txt"
1 Like

Thank you @Aram I am getting the result now,