Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
output lines
#1
its been a while.
Function Function1
Code:
Copy      Help
_s.getfile("$desktop$\Desktop\active-icmp.txt")

how can i output all lines that contain the word icmp?
#2
Function Function1
Code:
Copy      Help
out
str s.getfile("$desktop$\active-icmp.txt")
str line search_word="icmp"
foreach line s
,if(find(line search_word) != -1) out line
#3
here is the string im left with

example:
icmp 1 29 src=192.168.1.1 dst=10.10.12.134 type=8 code=0 id=3 src=10.10.12.134 dst=192.168.1.1 type=0 code=0 id=3 use=1

i need to get only the ip out of this part of string "dst=10.10.12.134 type=8 code=0" and assign the ip to another string.
#4
Function Function4
Code:
Copy      Help
out
str s="icmp 1 29 src=192.168.1.1 dst=10.10.12.134 type=8 code=0 id=3 src=10.10.12.134 dst=192.168.1.1 type=0 code=0 id=3 use=1"
ARRAY(str) a; str ip
if(findrx(s "dst=(\d.*.\d.*.\d.*.\d.*) type=8" 0 0 a) < 0)  out "does not match"; ret
int i
for i 1 a.len
,;out a[i]
,ip = a[i]
out F"IP address = {ip}"


Forum Jump:


Users browsing this thread: 1 Guest(s)