Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Need help in scripting for string functions

The idea is I will have the below as a paragraph in the column "Description". Can somebody help me to do a script which will result me the computer name alone. Example: the result of the script has to be ABCD1238.eu.corp

From: ch.alerts@abcd.com

Sent: Thursday, March 05, 2015 6:01 PM

To: Security.IncidentResponseTeam

Subject: Forefront Endpoint Protection Alert: Malware Detection


Forefront Endpoint Protection has detected malware on a computer in your organization.

Detection time (UTC): 3/5/2015 11:54:32 AM

Computer name: ABCD1238.eu.corp

Malware name: BrowserModifier:Win32/KipodToolsCby

1 Solution

Accepted Solutions
simenkg
Specialist
Specialist

subfield(textbetween(Description, 'Computer name: ' , 'Malware name:'),'_x000D_',1)

View solution in original post

9 Replies
Gysbert_Wassenaar

Try textbetween(Description, 'Computer name: ' , 'Malware name:')


talk is cheap, supply exceeds demand
Not applicable
Author

Try subfield(Description,'Computer name:',2)

Anonymous
Not applicable
Author

Hi Gysbert, I have tried Text Between. and I am I getting the below. Why I am getting _x000D_ and how should I remove this?

Computer Name
aoewallace2-sz.ap.corp_x000D_
BCNWS027.eu.corp_x000D_
BEER646.eu.corp_x000D_
CC4GKKVY1.ap.corp_x000D_
CCFSHYS2X.ap.corp_x000D_
cchen-wgq.ap.corp_x000D_
cmlu-wgq.ap.corp_x000D_
CRPWS027.na.corp_x000D_
CRPWS052.na.corp_x000D_
DEAC1190.eu.corp_x000D_
DEAC1238.eu.corp_x000D_
simenkg
Specialist
Specialist

subfield(textbetween(Description, 'Computer name: ' , 'Malware name:'),'_x000D_',1)

Anonymous
Not applicable
Author

Thanks Simen. Extraordinary it worked...

puttemans
Specialist
Specialist

If you are getting it, it means it is somewhere in the data. You can remove it at once with Simen's formula, although you could shorten the formula a bit :

subfield(textbetween(Description, 'Computer name: ' , 'Malware name:'),'_',1)

Anonymous
Not applicable
Author

Thanks everyone. Now I have got the Computer Name.. But I am not able to do this to get Malware name:

Any suggestions please?

simenkg
Specialist
Specialist

Subfield(Description,'Malware name:',2)

Anonymous
Not applicable
Author

Hi Simen it worked but I am again getting _x000D_ at the end