HttpLogger (logger)

De Wiki1000
(Différences entre les versions)
Ligne 54 : Ligne 54 :
 
Exemple :
 
Exemple :
  
 +
'''LOGGLY:'''
 
<pre>
 
<pre>
 
[\SOFTWARE\Sage\Ligne 1000\Administration\LOGManager\LOGGLY]
 
[\SOFTWARE\Sage\Ligne 1000\Administration\LOGManager\LOGGLY]
Ligne 63 : Ligne 64 :
 
headers = X-LOGGLY-TAG=[Service],[EventType],[Category]
 
headers = X-LOGGLY-TAG=[Service],[EventType],[Category]
 
content = [timestamp],[host],[port],[service],[level],[message],[EventType],[Category],[TenantID],[OrganizationName]
 
content = [timestamp],[host],[port],[service],[level],[message],[EventType],[Category],[TenantID],[OrganizationName]
 +
</pre>
 +
 +
'''Elastic Search:'''
 +
<pre>
 +
[\SOFTWARE\Sage\Ligne 1000\Administration\LOGManager\ELASTICSEARCH]
 +
type = http
 +
keep-alive = 1
 +
url = https://mycloudes.cloudapp.net/server/[Category]/[id]?timestamp=[timestamp]
 +
method = PUT
 +
contentType = application/json
 +
accept = application/json
 +
content = [timestamp],[host],[port],[service],[level],[message],[EventType],[Category],[TenantID],[OrganizationName],[UserName]
 +
</pre>
 +
 +
'''SPLUNKSTORM:'''
 +
<pre>
 +
[\SOFTWARE\Sage\Ligne 1000\Administration\LOGManager\SPLUNKSTORM]
 +
type = http
 +
keep-alive = 1
 +
url = https://x:X65k9VuIG4P3YMnYs8Xb5eisj7DH-eFsTndQvIixIvfUzcz9VxiUc11h0mumlzaf-XXXXXXXXX=@api.XXXXXX.data.splunkstorm.com/1/inputs/http?index=96cb75e2406b11e381f1123139097a14&sourcetype=sage1000
 +
method = POST
 +
contentType = application/x-www-form-urlencoded
 +
accept = application/json
 +
content = [timestamp],[host],[port],[service],[level],[message],[EventType],[Category],[TenantID],[OrganizationName]
 +
</pre>
 +
 +
'''GA:'''
 +
<pre>
 +
[\SOFTWARE\Sage\Ligne 1000\Administration\LOGManager\GA_HIT]
 +
type=http
 +
url=http://www.google-analytics.com/collect
 +
method=POST
 +
contentType=application/x-www-form-urlencoded
 +
accept=application/text
 +
keep-alive=0
 +
categories=hit');
 +
content=t=pageview&v=1&tid=[gaUA]&cid=[DeviceID]&cd1=[CustomerID]&cd2=[appName]-[appVersion]&cd3=[id]&cd4=[UserID]& \
 +
        dp=/[actionName]&dl=[hostURL]/[actionParams]&dr=[hostURL][actionReferrer]&cg1=[actionGroup1]&cg2=[actionGroup2]&cg3=[actionGroup3]& \
 +
        dt=[actionTitle]&sd=[systemColors]&sr=[systemScreen]
 
</pre>
 
</pre>
  

Version du 22 juillet 2014 à 14:50

Un logger http permet de transmettre des messages à un service externe via des requêtes HTTP.

Propriété Paramétrage Usage
type non http
url oui
method non défaut:POST
contentType non défaut:application/text ; valeurs:application/text; application/json; application/x-www-form-urlencoded
accept non défaut:application/text;
headers oui Custom headers de la requête
keep-alive non défaut:0 ; valeurs:0,1
user-agent oui Défaut:Mozilla/5.0 ([systemOSInfo]; [systemOSLanguage]) [platformInfo]/[platformVersion] [productInfo]/[productVersion]
content oui Contenu du message
categories non Liste des catégories gérées par le logger

Remarques :

  • Vous devez paramétrer le proxy si nécessaire.
  • Le format du message est conditionné par le paramètre contentType.

Exemple :

LOGGLY:

[\SOFTWARE\Sage\Ligne 1000\Administration\LOGManager\LOGGLY]
type = http
url = http://logs-01.loggly.com/inputs/40154792-94ba-45d9-87a9-xxxxxxxxx/
method = POST
contentType = application/x-www-form-urlencoded
accept = application/json
headers = X-LOGGLY-TAG=[Service],[EventType],[Category]
content = [timestamp],[host],[port],[service],[level],[message],[EventType],[Category],[TenantID],[OrganizationName]

Elastic Search:

[\SOFTWARE\Sage\Ligne 1000\Administration\LOGManager\ELASTICSEARCH]
type = http
keep-alive = 1
url = https://mycloudes.cloudapp.net/server/[Category]/[id]?timestamp=[timestamp]
method = PUT
contentType = application/json
accept = application/json
content = [timestamp],[host],[port],[service],[level],[message],[EventType],[Category],[TenantID],[OrganizationName],[UserName]

SPLUNKSTORM:

[\SOFTWARE\Sage\Ligne 1000\Administration\LOGManager\SPLUNKSTORM]
type = http
keep-alive = 1
url = https://x:X65k9VuIG4P3YMnYs8Xb5eisj7DH-eFsTndQvIixIvfUzcz9VxiUc11h0mumlzaf-XXXXXXXXX=@api.XXXXXX.data.splunkstorm.com/1/inputs/http?index=96cb75e2406b11e381f1123139097a14&sourcetype=sage1000
method = POST
contentType = application/x-www-form-urlencoded
accept = application/json
content = [timestamp],[host],[port],[service],[level],[message],[EventType],[Category],[TenantID],[OrganizationName]

GA:

[\SOFTWARE\Sage\Ligne 1000\Administration\LOGManager\GA_HIT]
type=http
url=http://www.google-analytics.com/collect
method=POST
contentType=application/x-www-form-urlencoded
accept=application/text
keep-alive=0
categories=hit');
content=t=pageview&v=1&tid=[gaUA]&cid=[DeviceID]&cd1=[CustomerID]&cd2=[appName]-[appVersion]&cd3=[id]&cd4=[UserID]& \
        dp=/[actionName]&dl=[hostURL]/[actionParams]&dr=[hostURL][actionReferrer]&cg1=[actionGroup1]&cg2=[actionGroup2]&cg3=[actionGroup3]& \
        dt=[actionTitle]&sd=[systemColors]&sr=[systemScreen]
Outils personnels