Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 213 of 796  Not logged in ELOG logo
ID Date Icon Author Author Email Category OS ELOG Versiondown Subject
  68436   Fri Sep 30 11:25:08 2016 Reply Alex Kühnelalexander.kuehnel@gmail.comQuestionLinux3.1.2Re: calculate diff of 2 date(s)

is ist possible that subst only works for the initial create of a logbook entry? when I change/edit one of the parameter "Einsatzbegin" or "Einsatzende" the "Einsatzzeit" is not changed.

regards

/alex

Alex Kühnel wrote:

I found the solution in the forum :-)

subst Einsatzzeit = $shell(/usr/local/elog/diff.sh \"$Einsatzbeginn\" \"$Einsatzende\")

and diff.sh is

#!/bin/sh
#set -x
s1=$(date -d "$1" +%s)
s2=$(date -d "$2" +%s)
d=$(echo "($s2-$s1)/60"|bc -lq)
printf "%.0f Minuten" $d
 

 

 

Alex Kühnel wrote:

hi

I have an elogsystem for documenting emergency services. I have a starttime and an endtime. Is it possible to calculate the diff between the 2 timestamps and convert it to minutes?

 

Attributes = Bereitschafts Kalender Woche, Bereitschafts Woche, Einsatzbeginn, Einsatzende, Einsatzzeit, Telefon Nummer, Station, Status, Problem 
Options Status= Offen{1}, Erledigt{2}, Geschlossen{3}

......

Type Einsatzbeginn = datetime
Type Einsatzende = datetime

....

Subst Einsatzzeit  = $shell(Einsatzende - Einsatzbeginn) 

 

regards

/alex

 

 

  68437   Fri Sep 30 12:33:38 2016 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux3.1.2Re: calculate diff of 2 date(s)

There is the "subst on edit = ..." option you should use in addition.

Stefan

Alex Kühnel wrote:

is ist possible that subst only works for the initial create of a logbook entry? when I change/edit one of the parameter "Einsatzbegin" or "Einsatzende" the "Einsatzzeit" is not changed.

regards

/alex

Alex Kühnel wrote:

I found the solution in the forum :-)

subst Einsatzzeit = $shell(/usr/local/elog/diff.sh \"$Einsatzbeginn\" \"$Einsatzende\")

and diff.sh is

#!/bin/sh
#set -x
s1=$(date -d "$1" +%s)
s2=$(date -d "$2" +%s)
d=$(echo "($s2-$s1)/60"|bc -lq)
printf "%.0f Minuten" $d
 

 

 

Alex Kühnel wrote:

hi

I have an elogsystem for documenting emergency services. I have a starttime and an endtime. Is it possible to calculate the diff between the 2 timestamps and convert it to minutes?

 

Attributes = Bereitschafts Kalender Woche, Bereitschafts Woche, Einsatzbeginn, Einsatzende, Einsatzzeit, Telefon Nummer, Station, Status, Problem 
Options Status= Offen{1}, Erledigt{2}, Geschlossen{3}

......

Type Einsatzbeginn = datetime
Type Einsatzende = datetime

....

Subst Einsatzzeit  = $shell(Einsatzende - Einsatzbeginn) 

 

regards

/alex

 

 

 

  68439   Mon Oct 3 10:01:53 2016 Reply Alex Kühnelalexander.kuehnel@gmail.comQuestionLinux3.1.2Re: calculate diff of 2 date(s)

thx!

Stefan Ritt wrote:

There is the "subst on edit = ..." option you should use in addition.

Stefan

Alex Kühnel wrote:

is ist possible that subst only works for the initial create of a logbook entry? when I change/edit one of the parameter "Einsatzbegin" or "Einsatzende" the "Einsatzzeit" is not changed.

regards

/alex

Alex Kühnel wrote:

I found the solution in the forum :-)

subst Einsatzzeit = $shell(/usr/local/elog/diff.sh \"$Einsatzbeginn\" \"$Einsatzende\")

and diff.sh is

#!/bin/sh
#set -x
s1=$(date -d "$1" +%s)
s2=$(date -d "$2" +%s)
d=$(echo "($s2-$s1)/60"|bc -lq)
printf "%.0f Minuten" $d
 

 

 

Alex Kühnel wrote:

hi

I have an elogsystem for documenting emergency services. I have a starttime and an endtime. Is it possible to calculate the diff between the 2 timestamps and convert it to minutes?

 

Attributes = Bereitschafts Kalender Woche, Bereitschafts Woche, Einsatzbeginn, Einsatzende, Einsatzzeit, Telefon Nummer, Station, Status, Problem 
Options Status= Offen{1}, Erledigt{2}, Geschlossen{3}

......

Type Einsatzbeginn = datetime
Type Einsatzende = datetime

....

Subst Einsatzzeit  = $shell(Einsatzende - Einsatzbeginn) 

 

regards

/alex

 

 

 

 

  68440   Mon Oct 3 10:02:36 2016 Idea Alex Kühnelalexander.kuehnel@gmail.comQuestionLinux3.1.2Is there a way to export logs

hello

Is there a way to export logs from elog (for example after I have selected a filter) to txt or csv...

I found the "Download" attribute but this works for only one elog entry...

regards

  68441   Mon Oct 3 10:18:19 2016 Reply Alex Kühnelalexander.kuehnel@gmail.comQuestionLinux3.1.2Re: Is there a way to export logs

shame on me, there is a way!

I can search with find and then export as csv file

/alex

Alex Kühnel wrote:

hello

Is there a way to export logs from elog (for example after I have selected a filter) to txt or csv...

I found the "Download" attribute but this works for only one elog entry...

regards

 

  68443   Wed Oct 26 16:39:38 2016 Question Alan Grantagrant@winnipeg.caQuestionWindows3.1.2Datetime format with elog client

What is the input format expected by the elog client for a required Datetime defined field when inserting a record? (Eg: October 26, 2016 = ? in the field's data parameter).

I have read some prior posts on this and the indication is that the input needs to use epoch time, however even when I enter 1477493161 or 0 the client still flags the variable data as missing. If this is in fact the format I shoud be using then I can provide a sample input and output message to illustrate my problem.

 
  68444   Wed Oct 26 21:41:42 2016 Reply Alan Grantagrant@winnipeg.caQuestionWindows3.1.2Re: Datetime format with elog client

UPDATE:

As I continue to test and troubleshoot this problem I noticed something peculiar: the Datetime defined field that the client is rejecting when I attempt a record insert is listed as a Required attribute. However, when I just remove it from the Required list the record including the epoch time is inserted without any problems.

I am now unsure if my configuration is deficient somewhere, vs a problem with the client program code.

Alan Grant wrote:

What is the input format expected by the elog client for a required Datetime defined field when inserting a record? (Eg: October 26, 2016 = ? in the field's data parameter).

I have read some prior posts on this and the indication is that the input needs to use epoch time, however even when I enter 1477493161 or 0 the client still flags the variable data as missing. If this is in fact the format I shoud be using then I can provide a sample input and output message to illustrate my problem.

 

 

  68445   Wed Oct 26 22:15:46 2016 Reply David PilgramDavid.Pilgram@epost.org.ukQuestionWindows3.1.2Re: Datetime format with elog client

Hi Alan,

I have no idea if this helps but the Date and Time formats in the config file internally interconnect, as I discovered in trying to define them separately.  Define one, and the other is defined.

I only mention this as I spent some hours trying to sort out the issue, only to learn it was a "feature" that Stefan didn't want to correct as it may affect too many others.  I can understand that, and made a different solution to what I wanted to do.

Alan Grant wrote:

UPDATE:

As I continue to test and troubleshoot this problem I noticed something peculiar: the Datetime defined field that the client is rejecting when I attempt a record insert is listed as a Required attribute. However, when I just remove it from the Required list the record including the epoch time is inserted without any problems.

I am now unsure if my configuration is deficient somewhere, vs a problem with the client program code.

Alan Grant wrote:

What is the input format expected by the elog client for a required Datetime defined field when inserting a record? (Eg: October 26, 2016 = ? in the field's data parameter).

I have read some prior posts on this and the indication is that the input needs to use epoch time, however even when I enter 1477493161 or 0 the client still flags the variable data as missing. If this is in fact the format I shoud be using then I can provide a sample input and output message to illustrate my problem.

 

 

 

ELOG V3.1.5-2eba886