There's probably better and faster ways of doing this.
Code:
alias logsearch {
  if !$2 { echo -a Insufficient parameters }
  else {
    if $exists($+($2,.txt)) {
      remove $+($2,.txt)
    }
    var %a = 1, %b = $findfile($logdir,*.*,0)
    while %a <= %b {
      var %file = $findfile($logdir,*.*,%a)
      if $read(%file,ntw,$+(*,$1,*)) {
        copy -a %file $+($2,.txt)
      }
      inc %a
    }
  }
}