I have the following text
Microsoft iSCSI Initiator version 2.0 Build 3497
Targets List:
iqn.2001-05.com.equallogic:0-8a0906-daef43402-138000002a4477ba-grsrv12-extra
iqn.2001-05.com.equallogic:0-8a0906-986f43402-520000002b447951-exchange
iqn.2001-05.com.equallogic:0-8a0906-a97ca4602-1dcf35dc2a647b3c-sql-2005-userdb-2008-02-13-23:59:03.85
iqn.2001-05.com.equallogic:0-8a0906-9ecca4602-cfef35dc2d547b4b-exchange-2008-02-14-17:00:12.95
iqn.2001-05.com.equallogic:0-8a0906-c20ca4602-850f35dc2e447b51-sql-2005-userdb-2008-02-14-23:59:12.99
iqn.2001-05.com.equallogic:0-8a0906-d97ca4602-94af35dc30a47b66-sql-2005-userdb-2008-02-15-23:59:03.110
iqn.2001-05.com.equallogic:0-8a0906-3d4ca4602-c54f35dc2eb47b59-virtual-data-2008-02-15-08:29:56.101
iqn.2001-05.com.equallogic:0-8a0906-606ca4602-578f35dc2ed47b59-sql-2005-userdb-2008-02-15-08:39:18.102
iqn.2001-05.com.equallogic:0-8a0906-802ca4602-4c0f35dc2ef47b59-sql-2005-userdb-2008-02-15-08:47:46.103
iqn.2001-05.com.equallogic:0-8a0906-872ca4602-d92f35dc2f147b59-sql-2005-userdb-clone-2008:02:15-08:49:51.491
iqn.2001-05.com.equallogic:0-8a0906-ff1ca4602-834f35dc31c47b72-sql-2005-userdb-2008-02-16-13:48:17.115
The operation completed successfully.
(each one is a full line)
What I need to do is select the entire line that matches a variable in this case SQL-2005-UserDB
What I need to do is select only the entries with a SQL-2005-UserDB and only the line that that is the oldest of that day.
I need the full line like
iqn.2001-05.com.equallogic:0-8a0906-ff1ca4602-834f35dc31c47b72-sql-2005-userdb-2008-02-16-13:48:17.115
I would like to use AWK..most of my other parsing is being done by awk where I have my AWK code in another file and I am calling the file using AWk -f file > another file.
I need help created in file with the code that will do what I need. I am struggling with the best way to accomplish this.