SID-00597: Include Log file from yesterday
| Status: |
Answered |
TWiki version: |
4.2.2 |
Perl version: |
5.005, 5.6.1 |
| Category: |
CategoryRendering |
Server OS: |
RHEL5 |
Last update: |
16 years ago |
Hello again,
i have a littele Problem. I want to include a LOG File from yesterday.
I defined some variable to get the right link (i think i did it very complicated)
Set Yesterday=20260709
Set LINK =
http://localhost/twiki/pub/XXX/statistik_share_20260709.log
and then
<pre>%INCLUDE{"%LINK%"}%<pre>
But i get always a error like "URL
http://localhost/twiki/pub/XXX/statistik_shares_20091027.log
Bad Request"
I tried it every way i know, but nothing works.
Someone a better Idea
thx in advanced slank
--
DanSlank - 2009-10-28
Discussion and Answer
Even though it's on localhost, the fact that you are accessing it via an http address (instead a topic name) makes it appear to be an external site. So, have you checked this setting? (from
VarINCLUDE):
- By default, the ability to INCLUDE arbitrary URLs [...] is turned off. To turn this on, make the change in the Security setup portion of your TWiki Config.
- JavaScript in included webpages is filtered out as a security precaution per default (disable filter with raw parameter)
--
SeanCMorgan - 2009-10-28
Make sure to create real bullets for settings, e.g 3 or 6 leading spaces if in raw edit. Example, shown as you would type in raw edit:
* Set Yesterday = %CALC{"$SUM(%GMTIME{"$year$mo$day"}%, -1)"}%
* Set LINK = http://localhost/twiki/pub/XXX/statistik_share_%Yesterday%.log
%LINK% now resolves to:
http://localhost/twiki/pub/XXX/statistik_share_20260709.log
--
PeterThoeny - 2009-10-28
BTW, to get an accurate previous day I would use
$TIME(),
$TIMEADD() and
$FORMATTIME().
--
PeterThoeny - 2009-10-28
thx for helping
The settings works fine, i get the right link with the date from yesterday (with 3 leading spaces). If i print my variable it shows the data (Link).
Also the settting in config "{INCLUDE}{AllowURLs}" is true.
but I get always the error URL
http://localhost/twiki/pub/XXX/LOGS/statistik_shares_20091028.log
Bad Request, but the file is there. If I inlude manually without calculating, it works fine. (same link)
and it doesen't matter if i write localhost or dns-name.
When I change to
<pre>%INCLUDE{"%LINK%"}%</pre>
i get this error:
Inkludieren von URL http://localhost/XXX/LOGS/statistik_shares_%CALC{"$FORMATTIME($TIMEADD($TIME(), -1, day), $year$month$day)"}%.log Bad Request fehlgeschlagen
I changed the calculation for yesterday in
%CALC{"$FORMATTIME($TIMEADD($TIME(), -1, day), $year$month$day)"}%... works perfect
--
DanSlank - 2009-10-29
Glad it worked out.
--
PeterThoeny - 2009-12-03
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.