Hi everyone,
When I started learning perl, I was working on a unix
machine. Now I work at a company that uses Microsoft
software. I am therefore using ActiveState's ActivePerl. I
need to parse some webserver logs and send the data to a
database. I wrote a script that did this, but it was kinda
slow, probably due to my writing it ineffeciently. So,
instead, I used a tool called LogParser, which was blazingly
fast on Microsoft-formatted webserver logs.
I call this program from the command line, such as
"logparser file1 dosomestuff goToDatabase" and it
does what I need. However, I need to do this to about 1000
gzipped logs and therefore need to use perl to do it.
So my program:
- copies a given logfile to a new directory
- gunzips it
- runs logparser and spits out the data to the db
- deletes unzipped copy
- repeats for all logfiles in directory
It works. The only problem, and what keeps it from being
at all useful, is that when I use system("command
here") or backticks (`command here`) in the perl script
to launch a dos window to run the logparser command, the
process runs as Perl, with the user being "system"
and in this way I am denied access to the database (I cannot
make an ODBC connection).
I tried all the different options with logparser, from
using a connection string, to providing separate
user/password parameters, to using a dsn, and all work if I
run the command from the command line, but none work if I
use perl to execute the command.
Is there any way to say "when spawning a new process,
run this perl command as user X" with windows? If it
was unix, I could just do something like
`su betterUser logparser file1 dosomestuff goToDatabase`;
but of course that doesn't work with Windows...
Thanks,
Tim
---------------------------------
The fish are biting.
Get more visitors on your site using Yahoo! Search
Marketing.
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor
--------------------~-->
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/4It09A/fOaOAA/yQLSAA/ndFolB/TM
------------------------------------------------------------
--------~->
Unsubscribing info is here: h
ttp://help.yahoo.com/help/us/groups/groups-32.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://g
roups.yahoo.com/group/perl-beginner/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http
://groups.yahoo.com/group/perl-beginner/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:perl-beginner-digest@yahoogroups.com
mailto:perl-beginner-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
perl-beginner-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.c
om/info/terms/
|