Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 102 of 238  Not logged in ELOG logo
icon5.gif   Elog client usage, posted by Alan Grant on Fri Jul 22 00:05:02 2011 

I have searched the Elog forum and docs at length for actual examples of how to use the Elog client and I apologize if I missed it somehwere but could someone please provide some actual examples of how the parmeters are used? I haven't had much success setting it up just going by the Elog command syntax quide.

What I intend to do is load a raw text file into an active logbook directly, either one line at at time or batched from a text file ("m" option).

Also, I saw a Perl script contribution somewhere on the site which appears to offer the same functionality as the above util. Just wondering why there would be two methods, and which might be the best for me to use?

Thank you.

    icon6.gif   Re: Elog client usage, posted by Andreas Luedeke on Fri Jul 22 10:31:27 2011 

Alan Grant wrote:

I have searched the Elog forum and docs at length for actual examples of how to use the Elog client and I apologize if I missed it somehwere but could someone please provide some actual examples of how the parmeters are used? I haven't had much success setting it up just going by the Elog command syntax quide.

What I intend to do is load a raw text file into an active logbook directly, either one line at at time or batched from a text file ("m" option).

Also, I saw a Perl script contribution somewhere on the site which appears to offer the same functionality as the above util. Just wondering why there would be two methods, and which might be the best for me to use? Thank you.

I suppose you have your demon "elogd" running and you can connect to your logbook via the web interface?
Then you can use the "elog" command to upload a text file as one entry.
If you want to split the text file to one-entry-per-line, you need to write a batch script to do that.
The usage of the "elog" command is descibed in the ELOG User's Guide: https://midas.psi.ch/elog/userguide.html#misc
 
The command line for "elog" has to define all "Required attributes" with "-a ..."
 
elog -h <host> -p <port> -l <logbook> -u <user> <password> -a <attribute>=<value> -n 1 -m <text-file>
 
<port> can be omitted if port 80 is used, "-u <user> <password>" can be omitted if anonymous entry creation is allowed.
Here's an example to write to the demo logbook at midas (local text file /tmp/hello.txt contains "hello world")
elog -h midas.psi.ch -l Linux+Demo -d elogs -a Author=nobody -a Type=Other -a Category=test -a "Subject=hello" -m /tmp/hello.txt

I hope this helps.

PS: please never refer to a location as "somewhere on the site".
       icon6.gif   Re: Elog client usage, posted by Alan Grant on Tue Jul 26 21:50:05 2011 elogd.cfg

Andreas Luedeke wrote:

Alan Grant wrote:

I have searched the Elog forum and docs at length for actual examples of how to use the Elog client and I apologize if I missed it somehwere but could someone please provide some actual examples of how the parmeters are used? I haven't had much success setting it up just going by the Elog command syntax quide.

What I intend to do is load a raw text file into an active logbook directly, either one line at at time or batched from a text file ("m" option).

Also, I saw a Perl script contribution somewhere on the site which appears to offer the same functionality as the above util. Just wondering why there would be two methods, and which might be the best for me to use? Thank you.

I suppose you have your demon "elogd" running and you can connect to your logbook via the web interface?
Then you can use the "elog" command to upload a text file as one entry.
If you want to split the text file to one-entry-per-line, you need to write a batch script to do that.
The usage of the "elog" command is descibed in the ELOG User's Guide: https://midas.psi.ch/elog/userguide.html#misc
 
The command line for "elog" has to define all "Required attributes" with "-a ..."
 
elog -h <host> -p <port> -l <logbook> -u <user> <password> -a <attribute>=<value> -n 1 -m <text-file>
 
<port> can be omitted if port 80 is used, "-u <user> <password>" can be omitted if anonymous entry creation is allowed.
Here's an example to write to the demo logbook at midas (local text file /tmp/hello.txt contains "hello world")
elog -h midas.psi.ch -l Linux+Demo -d elogs -a Author=nobody -a Type=Other -a Category=test -a "Subject=hello" -m /tmp/hello.txt

I hope this helps.

PS: please never refer to a location as "somewhere on the site".

 It seems straight forward enough but I must be missing something in my elog command string. I run the client utiltiy but it always hangs after pressing Enter from the cmd window. It could be the way I specifying the host or subdir but I'm not sure. I tried multiple variations.

Some more info: For the prototype I'm just running Elog locally. I installed it to my XP in "c:\program files\elog". I verified tht elogd process is running. With the Elog page already open (ref my attached cfg file) I typed the following, observing case sensitivity, then press enter and at this point it just hangs:

elog -h localhost -p 8080 -l Tartan+Tow+Log -d elog -a Ticket+date="Jul26/11"

Note since all attributes are optional I only included "Ticket Date" for now until I can get this cmd working.

Please bear with me as I don't have an extensive technical background but I would be very grateful for any help as it's for a project at work. Soonest response would be greatly appreciated.

Thanks.

Alan

 

 

 

          icon6.gif   Re: Elog client usage, posted by Andreas Luedeke on Wed Jul 27 04:36:40 2011 

Alan Grant wrote:

Andreas Luedeke wrote:

Alan Grant wrote:

What I intend to do is load a raw text file into an active logbook directly, either one line at at time or batched from a text file ("m" option). [...]

[...] The usage of the "elog" command is descibed in the ELOG User's Guide: https://midas.psi.ch/elog/userguide.html#misc

[...] I typed the following, observing case sensitivity, then press enter and at this point it just hangs:
elog -h localhost -p 8080 -l Tartan+Tow+Log -d elog -a Ticket+date="Jul26/11"
You wrote you want to upload a text file, then you need to add at the end "-m <file>". E.g. if the text-file is named "C:text.txt", then write:

elog -h localhost -p 8080 -l Tartan+Tow+Log -d elog -a Ticket+date="Jul26/11" -n 1 -m C:text.txt
The "-n 1" is just to tell elog to upload plain text. If you do not specify "-m <file>" then it expects input from a pipe and therefore hangs. If you don't know what "input from a pipe" means then ALWAYS use the "-m <file>" option.
 
PS: if "Ticket date" is of the format "date" then it is sensitive to the formatting of the date string. "Jul26/11" is likely not a legal date format. Better do not specify it for the first test. Write instead:
elog -h localhost -p 8080 -l Tartan+Tow+Log -d elog -n 1 -m C:text.txt
PPS: do you really use a sub-directory "elog" instead of the default location "logbooks" for your ELOG logbook files? If not, then leave out this option, too.
elog -h localhost -p 8080 -l Tartan+Tow+Log -n 1 -m C:text.txt
             icon2.gif   Re: Elog client usage, posted by Alan Grant on Tue Aug 2 21:36:20 2011 

Andreas Luedeke wrote:

Alan Grant wrote:

Andreas Luedeke wrote:

Alan Grant wrote:

What I intend to do is load a raw text file into an active logbook directly, either one line at at time or batched from a text file ("m" option). [...]

[...] The usage of the "elog" command is descibed in the ELOG User's Guide: https://midas.psi.ch/elog/userguide.html#misc

[...] I typed the following, observing case sensitivity, then press enter and at this point it just hangs:
elog -h localhost -p 8080 -l Tartan+Tow+Log -d elog -a Ticket+date="Jul26/11"
You wrote you want to upload a text file, then you need to add at the end "-m <file>". E.g. if the text-file is named "C:text.txt", then write:

elog -h localhost -p 8080 -l Tartan+Tow+Log -d elog -a Ticket+date="Jul26/11" -n 1 -m C:text.txt
The "-n 1" is just to tell elog to upload plain text. If you do not specify "-m <file>" then it expects input from a pipe and therefore hangs. If you don't know what "input from a pipe" means then ALWAYS use the "-m <file>" option.
 
PS: if "Ticket date" is of the format "date" then it is sensitive to the formatting of the date string. "Jul26/11" is likely not a legal date format. Better do not specify it for the first test. Write instead:
elog -h localhost -p 8080 -l Tartan+Tow+Log -d elog -n 1 -m C:text.txt
PPS: do you really use a sub-directory "elog" instead of the default location "logbooks" for your ELOG logbook files? If not, then leave out this option, too.
elog -h localhost -p 8080 -l Tartan+Tow+Log -n 1 -m C:text.txt

 Andreas, thank you very much. I was able to get the stand alone function working fine on my site, including a number of add'l attributes and options (SSL, etc).

 

icon5.gif   present Text, posted by Juergen Lupke on Tue Aug 2 13:55:06 2011 

I have define a MOption  BACKUP = Server, Switch, Router any now i link to use the Status of the Backup Option to display diffrent html file in the Text field, i the a posible way to do this ?

sample:

MOption  BACKUP = Server, Switch, Router

{Server&Switch&Router} Present Text = file1

{Server&Switch} Present Text  = file2

icon5.gif   List page displays internal 'Text' attribute header with some alias, posted by Zbigniew Reszela on Wed Jul 20 16:52:06 2011 

I would like to have different header for 'Text' internal attribute: e.g. an alias "Notes". So on the list page header of Text attribute column is Notes.

Is it already possible? I couldn't find it in Administrator's Guide. 

If not is it possible to add this feature?

    icon2.gif   Re: List page displays internal 'Text' attribute header with some alias, posted by Stefan Ritt on Wed Jul 20 17:39:25 2011 

Zbigniew Reszela wrote:

I would like to have different header for 'Text' internal attribute: e.g. an alias "Notes". So on the list page header of Text attribute column is Notes.

Is it already possible? I couldn't find it in Administrator's Guide. 

If not is it possible to add this feature?

No, this is not possible. I put this on the wish list. 

icon5.gif   changing raw style when empty attribute value, posted by Zbigniew Reszela on Thu Jul 14 19:53:13 2011 

Dear all,

I wonder if anyone of you already tried to  change raw style in case of empty attribute value.

In my configuration file I have defined attribute "End date" (without quotation marks) and it's type is datetime.

How should I configure extra style for entries where this attribute doesn't have value.

My tries were:

Style End date = background-color:red

Style End date "" = background-color:red

Style End date " " = background-color:red

Style End date - = background-color:red

But they didn't work.

Any ideas?

    icon2.gif   Re: changing raw style when empty attribute value, posted by Stefan Ritt on Wed Jul 20 13:50:34 2011 

Zbigniew Reszela wrote:

Dear all,

I wonder if anyone of you already tried to  change raw style in case of empty attribute value.

In my configuration file I have defined attribute "End date" (without quotation marks) and it's type is datetime.

How should I configure extra style for entries where this attribute doesn't have value.

My tries were:

Style End date = background-color:red

Style End date "" = background-color:red

Style End date " " = background-color:red

Style End date - = background-color:red

But they didn't work.

Any ideas?

This functionality was not implemented. I added it in SVN revision #2420, so it will be contained in the next release.

       icon2.gif   Re: changing raw style when empty attribute value, posted by Zbigniew Reszela on Wed Jul 20 17:38:16 2011 

Stefan Ritt wrote:

Zbigniew Reszela wrote:

Dear all,

I wonder if anyone of you already tried to  change raw style in case of empty attribute value.

In my configuration file I have defined attribute "End date" (without quotation marks) and it's type is datetime.

How should I configure extra style for entries where this attribute doesn't have value.

My tries were:

Style End date = background-color:red

Style End date "" = background-color:red

Style End date " " = background-color:red

Style End date - = background-color:red

But they didn't work.

Any ideas?

This functionality was not implemented. I added it in SVN revision #2420, so it will be contained in the next release.

Thanks a lot Stefan

icon5.gif   Attachments in a different logbook to the entry logbook, posted by David Pilgram on Wed Jul 6 12:45:19 2011 

Is it possible to have an attachment to an entry in a different directory to the working directory of the logbook being used?

By which I mean, if you have in logbook hidden the attachment files

../logbooks/hidden/110705_235520_whatthis-0.png
../logbooks/hidden/110705_235520_whatthis.pdf

that an entry in another logbook, public, can use the entries in hidden to show them (and do everything that you can do with an attachment)
without making another copy in public?

I see that if, working in public, you attach the .pdf file in hidden, the files get copied across as

../logbooks/public/110705_235520_whatthis-0.png
../logbooks/public/110705_235520_whatthis.pdf

that is, with the original (hidden) timestamp, and no second time stamp superimposed.  From which you can gather I've been playing around, manually editing a yymmdda.log file to try and get the result I want, even if for the moment it cannot be done via elog; but without success, although there were some bizarre interpretations by the elog program of the edited yymmdda.log file, depending upon what I tried.

For one entry, it is of course no big deal, copying the files into the public directory, but if you are dealing with multiple huge entries, it does seem wasteful of HD space

But my reason for this is that hidden has restricted access, whereas public has general access.  The attachments themselves are not restricted, but comments, history etc around them in the restricted access logbook should not become available to the general viewer.

icon5.gif   ELOG deamon stuck in find_thread_head(), posted by soren poulsen on Sat Apr 30 19:45:30 2011 

ELOG seems to enter a loop when you do certain opeations on certain messages: I moved a message to a different logbook and the deamon just gets stuck.

If I restart the daemon, the message was in fact moved: I can move it back to its original destination without problems.

I started in GDB and break with ctrl-C when the process gets stuck, to be told :

Program received signal SIGINT, Interrupt.
0x000000000040a968 in find_thread_head ()

I then made a core dump.

I put the files here: http://cern.ch/poulsen2/elog-error-report-110430.zip (they are too big to upload).

I get into the same problem in other circumstances such as when opening some threads (maybe because they contain "Reply-to" references to non-existing messages, but I have problems reproducing this on the test installation.

I should maybe also submit the incriminating thread.

Soren

 

    icon2.gif   Re: ELOG deamon stuck in find_thread_head(), posted by Soren Poulsen on Tue May 3 17:35:57 2011 

soren poulsen wrote:

ELOG seems to enter a loop when you do certain opeations on certain messages: I moved a message to a different logbook and the deamon just gets stuck.

If I restart the daemon, the message was in fact moved: I can move it back to its original destination without problems.

I started in GDB and break with ctrl-C when the process gets stuck, to be told :

Program received signal SIGINT, Interrupt.
0x000000000040a968 in find_thread_head ()

I then made a core dump.

I put the files here: http://cern.ch/poulsen2/elog-error-report-110430.zip (they are too big to upload).

I get into the same problem in other circumstances such as when opening some threads (maybe because they contain "Reply-to" references to non-existing messages, but I have problems reproducing this on the test installation.

I should maybe also submit the incriminating thread.

Soren

 

 1. It appears that some times find_thread_head is called with message references that do not exist. That is not good.

I put in a little check like this  before seeing if the message has an "in_reply_to" reference:

The line:

if (lbs->el_index[i].in_reply_to)

becomes:

if (i < *lbs->n_el_index && lbs->el_index[i].in_reply_to)
 

2. The trouble started when I deleted a message in the middle of a thread, which left the thread badly "connected" (references to a deleted message).

3. Also, when a thread is badly connected, it is a problem moving messages to a different logbook. ELOG complains that it cannot access the message (with the invalid reference). But ELOG should ignore it, since the message was deleted.

 

Soren

       icon8.gif   Re: ELOG deamon stuck in find_thread_head(), posted by Soren Poulsen on Wed Jul 6 12:06:01 2011 

Soren Poulsen wrote:

soren poulsen wrote:

ELOG seems to enter a loop when you do certain opeations on certain messages: I moved a message to a different logbook and the deamon just gets stuck.

If I restart the daemon, the message was in fact moved: I can move it back to its original destination without problems.

I started in GDB and break with ctrl-C when the process gets stuck, to be told :

Program received signal SIGINT, Interrupt.
0x000000000040a968 in find_thread_head ()

I then made a core dump.

I put the files here: http://cern.ch/poulsen2/elog-error-report-110430.zip (they are too big to upload).

I get into the same problem in other circumstances such as when opening some threads (maybe because they contain "Reply-to" references to non-existing messages, but I have problems reproducing this on the test installation.

I should maybe also submit the incriminating thread.

Soren

 

 1. It appears that some times find_thread_head is called with message references that do not exist. That is not good.

I put in a little check like this  before seeing if the message has an "in_reply_to" reference:

The line:

if (lbs->el_index[i].in_reply_to)

becomes:

if (i < *lbs->n_el_index && lbs->el_index[i].in_reply_to)
 

2. The trouble started when I deleted a message in the middle of a thread, which left the thread badly "connected" (references to a deleted message).

3. Also, when a thread is badly connected, it is a problem moving messages to a different logbook. ELOG complains that it cannot access the message (with the invalid reference). But ELOG should ignore it, since the message was deleted.

 

Soren

 It would be nice to have this corrected. The problem occurs when you select (read) a message which refers to another message via "In-reply-to", and this message does not exist.

Soren

          icon2.gif   Re: ELOG deamon stuck in find_thread_head(), posted by David Pilgram on Wed Jul 6 12:36:33 2011 

Soren Poulsen wrote:

Soren Poulsen wrote:

soren poulsen wrote:

ELOG seems to enter a loop when you do certain opeations on certain messages: I moved a message to a different logbook and the deamon just gets stuck.

If I restart the daemon, the message was in fact moved: I can move it back to its original destination without problems.

I started in GDB and break with ctrl-C when the process gets stuck, to be told :

Program received signal SIGINT, Interrupt.
0x000000000040a968 in find_thread_head ()

I then made a core dump.

I put the files here: http://cern.ch/poulsen2/elog-error-report-110430.zip (they are too big to upload).

I get into the same problem in other circumstances such as when opening some threads (maybe because they contain "Reply-to" references to non-existing messages, but I have problems reproducing this on the test installation.

I should maybe also submit the incriminating thread.

Soren

 

 1. It appears that some times find_thread_head is called with message references that do not exist. That is not good.

I put in a little check like this  before seeing if the message has an "in_reply_to" reference:

The line:

if (lbs->el_index[i].in_reply_to)

becomes:

if (i < *lbs->n_el_index && lbs->el_index[i].in_reply_to)
 

2. The trouble started when I deleted a message in the middle of a thread, which left the thread badly "connected" (references to a deleted message).

3. Also, when a thread is badly connected, it is a problem moving messages to a different logbook. ELOG complains that it cannot access the message (with the invalid reference). But ELOG should ignore it, since the message was deleted.

 

Soren

 It would be nice to have this corrected. The problem occurs when you select (read) a message which refers to another message via "In-reply-to", and this message does not exist.

Soren

Soren, you're not alone!  I've had similar problems, as did Sara Vanini (elog:67077).

 

In my case, it is because the "move" or "copy" function does not move all the messages in very long threads.   To be more precise, elog will crash in the attempt to move a long thread - say over 40 replies, I don't know for sure.  Sometimes it has already moved the entire thread before it crashes, sometimes not.  I'd not flagged it up as an issue because I could not be sure it was not a memory issue with the old (>12 years) linux box I was using earlier this year, but it still happens on this new (to me, only 3 years old) linux box.

 

Whether it is the number of entries, the total memory size of the thread or some combination, I don't know.

 

I've found that in the "move" case, it has not deleted all the messages from the donor thread, so that there is a semi-thread still hidden there.  Should one by chance select that semi-thread, (because it is found during a search) elog goes into infinate loop, which requires a reboot of this linux box to fix.   Certainly the pinning down the issue to the missing entry referenced by an <i>In reply to:</i> explains this part of the issue.  Of course, deletion of one entry within a thread, or other adjustments will do the same thing, just as you (Soren) point out above.

 

If it happens to me, I will go in to the yymmdda.log files and fix the problem, be it deleting the entries of the semi-thread, moving across missing entries from the donor to the acceptor logbooks, adjusting the <i>Reply:</i> and <i>In reply to:</i> lines, but that is quite a time consuming and error prone exercise.

icon4.gif   segmentation fault when "restrict edit" is used and "new" is allowed for anonymous users, posted by Andreas Luedeke on Mon Jun 20 05:31:31 2011 elogd.cfg
The simple config file below produces a segmentation fault when elogd is started,
http://localhost/Test/?cmd=New
is opened in the browser and then e.g. "Entry" is switched to "Problem".

gdb shows the following output:

(gdb) run -c /usr/local/elog/elogd.cfg
Starting program: /usr/local/sbin/elogd -c /usr/local/elog/elogd.cfg
elogd 2.9.0 built Jun 20 2011, 04:57:23 revision 2414
Falling back to default group "elog"
Falling back to default user "elog"
FCKedit detected
Falling back to default group "elog"
Falling back to default user "elog"
ImageMagick detected
Indexing logbooks ... done
Server listening on port 80 ...

Program received signal SIGSEGV, Segmentation fault.
0x080a2940 in get_user_line (lbs=0xae3c1c0, user=0x0, password=0x0, full_name=0xbfca1690 "", email=0x0, email_notify=0x0,
last_logout=0x0, inactive=0x0) at src/elogd.c:24864
24864 if (!str[0] || !user[0])
    icon2.gif   Re: segmentation fault when "restrict edit" is used and "new" is allowed for anonymous users, posted by Stefan Ritt on Mon Jun 20 17:53:58 2011 
You are the first one allowing guests to enter new entries, so this probes a code path which was never used before. I fixed the crash in SVN revision 2416, but it might be that there are more issues with that. Just keep reporting.
icon1.gif   Format in "Thread display", posted by Eoin Butler on Sat Jun 18 20:29:25 2011 
Is is possible to add formatting (such as <b> tags, etc..) to the "thread display" option?
ELOG V3.1.5-3fb85fa6