Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon4.gif   Using the command line tool to edit, posted by T. Ribbrock on Thu Aug 7 10:12:25 2008 
    icon2.gif   Re: Using the command line tool to edit, posted by Yoshio Imai on Fri Aug 8 14:27:03 2008 
       icon2.gif   Re: Using the command line tool to edit, posted by T. Ribbrock on Fri Aug 8 14:50:56 2008 
    icon2.gif   Re: Using the command line tool to edit, posted by Stefan Ritt on Mon Aug 11 11:02:18 2008 
       icon2.gif   Re: Using the command line tool to edit, posted by T. Ribbrock on Mon Aug 11 15:14:40 2008 
Message ID: 65943     Entry time: Thu Aug 7 10:12:25 2008     Reply to this: 65946   65949
Icon: Warning  Author: T. Ribbrock  Author Email: emgaron@gmx.net 
Category: Question  OS: Linux  ELOG Version: 2.7.4-2111 
Subject: Using the command line tool to edit 

I intend to create a script that updates one of our elog logbooks based on mails it receives. I was hoping to be able to do this using the "elog" command line tool. Adding a new entry works fine, as does "replying" to an existing entry. The only thing I cannot get to work is editing an existing entry. All entries ahve several attributes and I intend not to use the "message" itself. I tried the following (on the machine this elogd is running on):

  1. Create a new entry with Attribute1 set to "value":

    elog -a 'Attribute1=value' -x -h localhost -l 'LOGBOOK' -p 8080 -u USER PASSWD

    This works - the entry gets created and is displayed properly.
    NOTE: I found that this does not work if LOGBOOK has any spaces in it - I would get error messages where the logbook was not found.
     
  2. Edit this entry to set a second attribute:

    elog -e 1 -a 'Attribute2=something' -x -h localhost -l 'LOGBOOK' -p 8080 -u USER PASSWD

    The result was: Error transmitting message. Running the same command with -v gives me a whole bunch of text with at the end this message (I've stripped the HTML): "This entry has in meantime been modified by someone else. Submitting it now would overwrite the other modification and is therefore prohibited." However, I know for certain that this entry is not being editied by anyone at that moment, so I'm wondering what I'm doing wrong here...

Also, I have a second, related question: Editing by the ID of the entry seems to be the only way of editing an entry - this makes it a bit difficult for me, as all entries already have a unique ID (which is defined as one of the attributes) that is non-numerical and not sequential. What is the easiest way to retrieve an ID from the command line (basically something like: "What ID has the entry with Attribute1==NAME?")? Is it possible at all? Otherwise, I would not be able to automatically edit the entries, as I don't know which is which... :-}

ELOG V3.1.5-fe60aaf