RSS구독하기:SUBSCRIBE TO RSS FEED
즐겨찾기추가:ADD FAVORITE
글쓰기:POST
관리자:ADMINISTRATOR
syslog-ng version: # syslog-ng --version syslog-ng 3.2.5 This is my nginx log format: log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; syslog-ng source: source nginx { file( "/var/log/nginx/tg-test-3.access.log" follow_freq(1) flags(no-parse) ); }; syslog-ng destination: destination d_sql { sql(type(mysql) host("127.0.0.1") username("syslog") password("superpasswd") database("syslog") table("nginx") columns("remote_addr","remote_user","time_local","request","status","body_bytes_sent","http_ referer","http_user_agent","http_x_forwarded_for") values("$REMOTE_ADDR", "$REMOTE_USER", "$TIME_LOCAL", "$REQUEST", "$STATUS","$BODY_BYTES_SENT", "$HTTP_REFERER", "$HTTP_USER_AGENT", "$HTTP_X_FORWARDED_FOR")); }; MySQL table for testing purposes: CREATE TABLE `nginx` ( `remote_addr` varchar(100) DEFAULT NULL, `remote_user` varchar(100) DEFAULT NULL, `time` varchar(100) DEFAULT NULL, `request` varchar(100) DEFAULT NULL, `status` varchar(100) DEFAULT NULL, `body_bytes_sent` varchar(100) DEFAULT NULL, `http_referer` varchar(100) DEFAULT NULL, `http_user_agent` varchar(100) DEFAULT NULL, `http_x_forwarded_for` varchar(100) DEFAULT NULL, `time_local` text, `datetime` text, `host` text, `program` text, `pid` text, `message` text ) ENGINE=InnoDB DEFAULT CHARSET=latin1 Now first thing that goes wrong is when I restart syslog-ng: # /etc/init.d/syslog-ng restart Stopping syslog-ng: [ OK ] Starting syslog-ng: WARNING: You are using the default values for columns(), indexes() or values(), please specify these explicitly as the default will be dropped in the future; [ OK ] I have tried creating a file destination and it all works fine, and then I have tried replacing my destination with: destination d_sql { sql(type(mysql) host("127.0.0.1") username("syslog") password("kosmodromas") database("syslog") table("nginx") columns("datetime", "host", "program", "pid", "message") values("$R_DATE", "$HOST", "$PROGRAM", "$PID", "$MSGONLY") indexes("datetime", "host", "program", "pid", "message")); }; Which did work and it was writing stuff to mysql, The problem is that I want to write stuff to in exact format as nginx log format is. I assume that I am missing something really simple or I need to do some parsing between source and destination. Any help will be much appreciated :)
2014/07/15 10:30 2014/07/15 10:30
http://zosel.net/trackback/145
from.Orientalische Kleidung  2015/07/05 07:45
::: ZOSEL ::: ::
from.オークリー サングラス  2015/11/09 15:36
こんにちは に関するについて 同僚、あなたは意見を共有しているウェブサイト What is my IP address - determine or retrieve my IP address 、私はまた、ウェブの新しいユーザ午前、こうして私もそれからより多くを取得しています。おかげすべて。
from.Ugg Eu  2015/11/09 16:05
shoes nike shop
ZOSEL:Too much is as bad as too little...!! 자공(子貢)이 공자에게 "사(師:子張의 이름)와 상(商:子夏의 이름)은 어느 쪽이 어집니까?" 하고 묻자, 공자는 "사는 지나치고 상은 미치지 못한다"고 대답하였다. "그럼 사가 낫단 말씀입니까?" 하고 반문하자, 공자는 "지나친 것은 미치지 못한 것과 같다(過猶不及)"고 말하였다.
Too much is as bad as too little...!! 자공(子貢)이 공자에게 "사(師:子張의 이름)와 상(商:子夏의 이름)은 어느 쪽이 어집니까?" 하고 묻자, 공자는 "사는 지나치고 상은 미치지 못한다"고 대답하였다. "그럼 사가 낫단 말씀입니까?" 하고 반문하자, 공자는 "지나친 것은 미치지 못한 것과 같다(過猶不及)"고 말하였다.
전체 (209)
리눅스시스템 (92)
윈도우시스템 (16)
프로그램 (7)
네트워크시스템 (7)
최근관심 (1)
«   2024/05   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
  1. yeezyboost-350.co.uk  2021
    yeezyboost-350.co.uk
  2. 강남역 풀싸롱  2021
    강남역 풀싸롱
  3.   2021
  1. 2018/02 (1)
  2. 2017/03 (2)
  3. 2016/12 (2)