Eu tenho rsyslog 7.6.7 no servidor com algum arquivo que contém
2018-07-19 12:38:49~,~"Phone" <672094>~,~672094~,~0~,~atx_78342~,~SIP/teleserver-1.ha-000000ce~,~SIP/s_ru-000000cf~,~Dial~,~SIP/s_ru/1#00#100,,trg~,~4.880648~,~0.000000~,~NO ANSWER~,~DOCUMENTATION~,~~,~~,~212.62.62.11~,~6282837472.210~,~~,~in_sajdh3hg2321nb312bv3sae3b2j4v2k3jgv42h3gv423~,~~,~2018-07-19 12:38:53
2018-07-19 12:38:49~,~"Phone" <672094>~,~672094~,~100~,~atx_78342~,~SIP/s_en-000000d0~,~SIP/s_ru-000000d1~,~Dial~,~SIP/s_ru/59393-100,20,t~,~4.551456~,~0.000000~,~NO ANSWER~,~DOCUMENTATION~,~~,~~,~~,~6282837472.212~,~~,~in_sajdh3hg2321nb312bv3sae3b2j4v2k3jgv42h3gv423~,~~,~2018-07-19 12:38:53
2018-07-19 12:39:21~,~"Phone" <672094>~,~672094~,~59393-100~,~search_peer_context~,~SIP/s_en-000000d7~,~SIP/teleserver-dev.ha-000000e4~,~Hangup~,~31~,~18.012724~,~0.000000~,~NO ANSWER~,~DOCUMENTATION~,~~,~~,~~,~1984726432.219~,~~,~in_sajdh3hg2321nb312bv3sae3b2j4v2k3jgv42h3gv423~,~~,~2018-07-19 12:39:39
Eu preciso obtê-lo deste arquivo e colocar no mysql com o rsyslog para a tabela
CREATE TABLE atx_asterisk_cdr (
calldate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
clid varchar(80) NOT NULL DEFAULT '',
src varchar(80) NOT NULL DEFAULT '',
dst varchar(80) NOT NULL DEFAULT '',
dcontext varchar(80) NOT NULL DEFAULT '',
channel varchar(80) NOT NULL DEFAULT '',
dstchannel varchar(80) NOT NULL DEFAULT '',
lastapp varchar(80) NOT NULL DEFAULT '',
lastdata varchar(80) NOT NULL DEFAULT '',
duration int(11) NOT NULL DEFAULT '0',
billsec int(11) NOT NULL DEFAULT '0',
disposition varchar(45) NOT NULL DEFAULT '',
amaflags int(11) NOT NULL DEFAULT '0',
accountcode varchar(20) NOT NULL DEFAULT '',
userfield varchar(255) NOT NULL DEFAULT '',
userip varchar(50) NOT NULL,
uniqueid varchar(32) NOT NULL DEFAULT '',
called_did varchar(25) DEFAULT NULL,
atx_call_id varchar(64) DEFAULT NULL,
KEY calldate (calldate),
KEY dst (dst),
KEY accountcode (accountcode),
KEY clid (clid),
KEY src (src),
KEY dcontext (dcontext),
KEY channel (channel),
KEY dstchannel (dstchannel),
KEY lastdata (lastdata),
KEY duration (duration),
KEY billsec (billsec),
KEY disposition (disposition),
KEY amaflags (amaflags),
KEY userfield (userfield),
KEY uniqueid (uniqueid),
KEY called_did (called_did),
KEY atx_call_id (atx_call_id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Eu uso para isso imfile e ommysql. Então, você poderia me ajudar a fazer um template para alterar o formato dessas mensagens para minha tabela mysql?