You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by HarJin Park <ha...@gmail.com> on 2014/04/10 10:55:24 UTC

'ServerHosts' in 'logs_xml.config not work

Hi

I'm using 4.2.0 TS, my config file is below.


<LogFormat>

 <Name = "cachelog"/>

....

</LogFormat>


<LogFilter>

 <Name = "ERROR_UNKNOWN"/>

 <Condition = "crc MATCH 90"/>

 <Action = "REJECT"/>

</LogFilter>


<LogObject>

 <Format = "cachelog"/>

 <Filename = "test"/>

 <Protocols = "http"/>

 <ServerHosts = "test.test.com"/>

</LogObject>


There is no log file even I  did using curl 'http://test.test.com'.

If I remove 'SeverHosts' tag, it is work well.


I don't know why it's not work, plz give me some examples.


Thanks.

Re: 'ServerHosts' in 'logs_xml.config not work

Posted by HarJin Park <ha...@gmail.com>.
Hi

Custom log work well, if it does not apply "ServerHosts" tag.
I have to gather log as service domain.

Thanks.


2014-04-11 5:46 GMT+09:00 Leif Hedstrom <zw...@apache.org>:

>
> On Apr 10, 2014, at 2:42 PM, James Peach <jp...@apache.org> wrote:
>
> > On Apr 10, 2014, at 1:29 PM, Leif Hedstrom <zw...@apache.org> wrote:
> >
> >> ServerHost is for log collation. I'm guess that's not what you want
> (unless you have a log collation collector running on test.test.com).
> >
> > I think you are confusing that with CollationHosts :)
> >
>
> Oh, humm, yes. Then I have no idea :).
>
> - Leif
>
> >>
> >> Also make sure custom log format is enabled in records.config
> >>
> >> -- Leif
> >>
> >> On Apr 10, 2014, at 2:55 AM, HarJin Park <ha...@gmail.com> wrote:
> >>
> >>> Hi
> >>> I'm using 4.2.0 TS, my config file is below.
> >>>
> >>> <LogFormat>
> >>> <Name = "cachelog"/>
> >>> ....
> >>> </LogFormat>
> >>>
> >>> <LogFilter>
> >>> <Name = "ERROR_UNKNOWN"/>
> >>> <Condition = "crc MATCH 90"/>
> >>> <Action = "REJECT"/>
> >>> </LogFilter>
> >>>
> >>> <LogObject>
> >>> <Format = "cachelog"/>
> >>> <Filename = "test"/>
> >>> <Protocols = "http"/>
> >>> <ServerHosts = "test.test.com"/>
> >>> </LogObject>
> >>>
> >>> There is no log file even I  did using curl 'http://test.test.com'.
> >>> If I remove 'SeverHosts' tag, it is work well.
> >>>
> >>> I don't know why it's not work, plz give me some examples.
> >>>
> >>> Thanks.
> >>>
> >>
> >
>
>

Re: 'ServerHosts' in 'logs_xml.config not work

Posted by Leif Hedstrom <zw...@apache.org>.
On Apr 10, 2014, at 2:42 PM, James Peach <jp...@apache.org> wrote:

> On Apr 10, 2014, at 1:29 PM, Leif Hedstrom <zw...@apache.org> wrote:
> 
>> ServerHost is for log collation. I’m guess that’s not what you want (unless you have a log collation collector running on test.test.com).
> 
> I think you are confusing that with CollationHosts :)
> 

Oh, humm, yes. Then I have no idea :).

- Leif

>> 
>> Also make sure custom log format is enabled in records.config
>> 
>> — Leif
>> 
>> On Apr 10, 2014, at 2:55 AM, HarJin Park <ha...@gmail.com> wrote:
>> 
>>> Hi
>>> I'm using 4.2.0 TS, my config file is below.
>>> 
>>> <LogFormat>
>>> <Name = "cachelog"/>
>>> ....
>>> </LogFormat>
>>> 
>>> <LogFilter>
>>> <Name = "ERROR_UNKNOWN"/>
>>> <Condition = "crc MATCH 90"/>
>>> <Action = "REJECT"/>
>>> </LogFilter>
>>> 
>>> <LogObject>
>>> <Format = "cachelog"/>
>>> <Filename = "test"/>
>>> <Protocols = "http"/>
>>> <ServerHosts = "test.test.com"/>
>>> </LogObject>
>>> 
>>> There is no log file even I  did using curl 'http://test.test.com'.
>>> If I remove 'SeverHosts' tag, it is work well.
>>> 
>>> I don't know why it's not work, plz give me some examples.
>>> 
>>> Thanks.
>>> 
>> 
> 


Re: 'ServerHosts' in 'logs_xml.config not work

Posted by James Peach <jp...@apache.org>.
On Apr 10, 2014, at 1:29 PM, Leif Hedstrom <zw...@apache.org> wrote:

> ServerHost is for log collation. I’m guess that’s not what you want (unless you have a log collation collector running on test.test.com).

I think you are confusing that with CollationHosts :)

> 
> Also make sure custom log format is enabled in records.config
> 
> — Leif
> 
> On Apr 10, 2014, at 2:55 AM, HarJin Park <ha...@gmail.com> wrote:
> 
>> Hi
>> I'm using 4.2.0 TS, my config file is below.
>> 
>> <LogFormat>
>>  <Name = "cachelog"/>
>> ....
>> </LogFormat>
>> 
>> <LogFilter>
>>  <Name = "ERROR_UNKNOWN"/>
>>  <Condition = "crc MATCH 90"/>
>>  <Action = "REJECT"/>
>> </LogFilter>
>> 
>> <LogObject>
>>  <Format = "cachelog"/>
>>  <Filename = "test"/>
>>  <Protocols = "http"/>
>>  <ServerHosts = "test.test.com"/>
>> </LogObject>
>> 
>> There is no log file even I  did using curl 'http://test.test.com'.
>> If I remove 'SeverHosts' tag, it is work well.
>> 
>> I don't know why it's not work, plz give me some examples.
>> 
>> Thanks.
>> 
> 


Re: 'ServerHosts' in 'logs_xml.config not work

Posted by Leif Hedstrom <zw...@apache.org>.
ServerHost is for log collation. I’m guess that’s not what you want (unless you have a log collation collector running on test.test.com).

Also make sure custom log format is enabled in records.config

— Leif

On Apr 10, 2014, at 2:55 AM, HarJin Park <ha...@gmail.com> wrote:

> Hi
> I'm using 4.2.0 TS, my config file is below.
> 
> <LogFormat>
>  <Name = "cachelog"/>
> ....
> </LogFormat>
> 
> <LogFilter>
>  <Name = "ERROR_UNKNOWN"/>
>  <Condition = "crc MATCH 90"/>
>  <Action = "REJECT"/>
> </LogFilter>
> 
> <LogObject>
>  <Format = "cachelog"/>
>  <Filename = "test"/>
>  <Protocols = "http"/>
>  <ServerHosts = "test.test.com"/>
> </LogObject>
> 
> There is no log file even I  did using curl 'http://test.test.com'.
> If I remove 'SeverHosts' tag, it is work well.
> 
> I don't know why it's not work, plz give me some examples.
> 
> Thanks.
> 


Re: 'ServerHosts' in 'logs_xml.config not work

Posted by Yongming Zhao <mi...@gmail.com>.
 I really don’t think the summary is able to send to the collation server, please file a jira for this new feature if you really want to.

as aways, patch welcome.

- Yongming Zhao 赵永明

在 2014年4月14日,下午3:09,HarJin Park <ha...@gmail.com> 写道:

> Thank you, it's work well.
> 
> Next step is to put the summary log to log collation server.
> So I config  like this.
> 
> <LogFormat>
>     <Name = "summary"/>
>     <Format = "%<LAST(cqts)> : %<COUNT(*)> : %<SUM(psql)>"/>
>     <Interval = "10"/>
> </LogFormat>
> 
> <LogObject>
>  <Format = "summary"/>
>  <Filename = "summary"/>
>  <Protocols = "http"/>
>  <ServerHosts = "origin.example.com"/>
>  <CollationHosts = "collation.test.com:4000"/>
> </LogObject>
> 
> I want to make summary log to 'collation.test.com'  but it's not work.
> I don't know why. Could you help me ?
> 
> 
> 
> 2014-04-11 15:23 GMT+09:00 Yongming Zhao <mi...@gmail.com>:
> yeah, that is the mapped issue. you may find out one of the following two ways for your needs:
> 1, make use of the DNS system instead of the ip address in remap.config:
> 
> map http://test.test.com/ http://origin.test.com/
> 
> and setup your dns to resolve origin.test.com to your ip address, then you may use the ServerHosts directives in logs_xml.config file.
> 
> 2, write your own LogFilters instead of ‘ServerHosts’ directive.
>  
> using the ‘cquuh’ to get the origin client query host.
> 
> 
> btw, ServerHosts is a quick LogFilters on the mapped hostname.
> 
> FYI
> 
> - Yongming Zhao 赵永明
> 
> 在 2014年4月11日,下午1:21,HarJin Park <ha...@gmail.com> 写道:
> 
>> Hello Zhao
>> 
>> My remap.config is below.
>> 
>> map  http://test.test.com/      http://192.168.10.100/
>> reverse_map      http://192.168.10.100/      http://test.test.com/
>> map  http://abc.abc.com/      http://192.168.10.200/
>> reverse_map      http://192.168.10.200/      http://abc.abc.com/
>> 
>> 
>> I'd like to separate logging abc.com and test.com
>> 
>> Thanks.
>> 
>> 
>> 
>> 2014-04-11 12:09 GMT+09:00 Yongming Zhao <mi...@gmail.com>:
>> what is in your remap if you running a reversed proxy? the logging is based on the remapped URI, that is the server name after remap.
>> 
>> is that the problem?
>> 
>> thanks
>> 
>> - Yongming Zhao 赵永明
>> 
>> 在 2014年4月10日,下午4:55,HarJin Park <ha...@gmail.com> 写道:
>> 
>>> Hi
>>> I'm using 4.2.0 TS, my config file is below.
>>> 
>>> <LogFormat>
>>>  <Name = "cachelog"/>
>>> ....
>>> </LogFormat>
>>> 
>>> <LogFilter>
>>>  <Name = "ERROR_UNKNOWN"/>
>>>  <Condition = "crc MATCH 90"/>
>>>  <Action = "REJECT"/>
>>> </LogFilter>
>>> 
>>> <LogObject>
>>>  <Format = "cachelog"/>
>>>  <Filename = "test"/>
>>>  <Protocols = "http"/>
>>>  <ServerHosts = "test.test.com"/>
>>> </LogObject>
>>> 
>>> There is no log file even I  did using curl 'http://test.test.com'.
>>> If I remove 'SeverHosts' tag, it is work well.
>>> 
>>> I don't know why it's not work, plz give me some examples.
>>> 
>>> Thanks.
>>> 
>> 
>> 
> 
> 


Re: 'ServerHosts' in 'logs_xml.config not work

Posted by Yongming Zhao <mi...@gmail.com>.
 I really don’t think the summary is able to send to the collation server, please file a jira for this new feature if you really want to.

as aways, patch welcome.

- Yongming Zhao 赵永明

在 2014年4月14日,下午3:09,HarJin Park <ha...@gmail.com> 写道:

> Thank you, it's work well.
> 
> Next step is to put the summary log to log collation server.
> So I config  like this.
> 
> <LogFormat>
>     <Name = "summary"/>
>     <Format = "%<LAST(cqts)> : %<COUNT(*)> : %<SUM(psql)>"/>
>     <Interval = "10"/>
> </LogFormat>
> 
> <LogObject>
>  <Format = "summary"/>
>  <Filename = "summary"/>
>  <Protocols = "http"/>
>  <ServerHosts = "origin.example.com"/>
>  <CollationHosts = "collation.test.com:4000"/>
> </LogObject>
> 
> I want to make summary log to 'collation.test.com'  but it's not work.
> I don't know why. Could you help me ?
> 
> 
> 
> 2014-04-11 15:23 GMT+09:00 Yongming Zhao <mi...@gmail.com>:
> yeah, that is the mapped issue. you may find out one of the following two ways for your needs:
> 1, make use of the DNS system instead of the ip address in remap.config:
> 
> map http://test.test.com/ http://origin.test.com/
> 
> and setup your dns to resolve origin.test.com to your ip address, then you may use the ServerHosts directives in logs_xml.config file.
> 
> 2, write your own LogFilters instead of ‘ServerHosts’ directive.
>  
> using the ‘cquuh’ to get the origin client query host.
> 
> 
> btw, ServerHosts is a quick LogFilters on the mapped hostname.
> 
> FYI
> 
> - Yongming Zhao 赵永明
> 
> 在 2014年4月11日,下午1:21,HarJin Park <ha...@gmail.com> 写道:
> 
>> Hello Zhao
>> 
>> My remap.config is below.
>> 
>> map  http://test.test.com/      http://192.168.10.100/
>> reverse_map      http://192.168.10.100/      http://test.test.com/
>> map  http://abc.abc.com/      http://192.168.10.200/
>> reverse_map      http://192.168.10.200/      http://abc.abc.com/
>> 
>> 
>> I'd like to separate logging abc.com and test.com
>> 
>> Thanks.
>> 
>> 
>> 
>> 2014-04-11 12:09 GMT+09:00 Yongming Zhao <mi...@gmail.com>:
>> what is in your remap if you running a reversed proxy? the logging is based on the remapped URI, that is the server name after remap.
>> 
>> is that the problem?
>> 
>> thanks
>> 
>> - Yongming Zhao 赵永明
>> 
>> 在 2014年4月10日,下午4:55,HarJin Park <ha...@gmail.com> 写道:
>> 
>>> Hi
>>> I'm using 4.2.0 TS, my config file is below.
>>> 
>>> <LogFormat>
>>>  <Name = "cachelog"/>
>>> ....
>>> </LogFormat>
>>> 
>>> <LogFilter>
>>>  <Name = "ERROR_UNKNOWN"/>
>>>  <Condition = "crc MATCH 90"/>
>>>  <Action = "REJECT"/>
>>> </LogFilter>
>>> 
>>> <LogObject>
>>>  <Format = "cachelog"/>
>>>  <Filename = "test"/>
>>>  <Protocols = "http"/>
>>>  <ServerHosts = "test.test.com"/>
>>> </LogObject>
>>> 
>>> There is no log file even I  did using curl 'http://test.test.com'.
>>> If I remove 'SeverHosts' tag, it is work well.
>>> 
>>> I don't know why it's not work, plz give me some examples.
>>> 
>>> Thanks.
>>> 
>> 
>> 
> 
> 


Re: 'ServerHosts' in 'logs_xml.config not work

Posted by HarJin Park <ha...@gmail.com>.
Thank you, it's work well.

Next step is to put the summary log to log collation server.
So I config  like this.

<LogFormat>
    <Name = "summary"/>
    <Format = "%<LAST(cqts)> : %<COUNT(*)> : %<SUM(psql)>"/>
    <Interval = "10"/>
</LogFormat>

<LogObject>
 <Format = "summary"/>
 <Filename = "summary"/>
 <Protocols = "http"/>
 <ServerHosts = "origin.example.com"/>
 <CollationHosts = "collation.test.com:4000"/>
</LogObject>

I want to make summary log to 'collation.test.com'  but it's not work.
I don't know why. Could you help me ?



2014-04-11 15:23 GMT+09:00 Yongming Zhao <mi...@gmail.com>:

> yeah, that is the mapped issue. you may find out one of the following two
> ways for your needs:
> 1, make use of the DNS system instead of the ip address in remap.config:
>
> map http://test.test.com/ http://origin.test.com/
>
> and setup your dns to resolve origin.test.com to your ip address, then
> you may use the ServerHosts directives in logs_xml.config file.
>
> 2, write your own LogFilters instead of ‘ServerHosts’ directive.
>
> using the ‘cquuh’ to get the origin client query host.
>
>
> btw, ServerHosts is a quick LogFilters on the mapped hostname.
>
> FYI
>
> - Yongming Zhao 赵永明
>
> 在 2014年4月11日,下午1:21,HarJin Park <ha...@gmail.com> 写道:
>
> Hello Zhao
>
> My remap.config is below.
>
> map  http://test.test.com/      http://192.168.10.100/
> reverse_map      http://192.168.10.100/      http://test.test.com/
> map  http://abc.abc.com <http://test.test.com/>/
> http://192.168.10.200/
> reverse_map      http://192.168.10.200/      http://abc.abc.com/
>
>
> I'd like to separate logging abc.com and test.com
>
> Thanks.
>
>
>
> 2014-04-11 12:09 GMT+09:00 Yongming Zhao <mi...@gmail.com>:
>
>> what is in your remap if you running a reversed proxy? the logging is
>> based on the remapped URI, that is the server name after remap.
>>
>> is that the problem?
>>
>> thanks
>>
>>  - Yongming Zhao 赵永明
>>
>> 在 2014年4月10日,下午4:55,HarJin Park <ha...@gmail.com> 写道:
>>
>> Hi
>> I'm using 4.2.0 TS, my config file is below.
>>
>> <LogFormat>
>>  <Name = "cachelog"/>
>>  ....
>> </LogFormat>
>>
>> <LogFilter>
>>  <Name = "ERROR_UNKNOWN"/>
>>  <Condition = "crc MATCH 90"/>
>>  <Action = "REJECT"/>
>> </LogFilter>
>>
>> <LogObject>
>>  <Format = "cachelog"/>
>>  <Filename = "test"/>
>>  <Protocols = "http"/>
>>  <ServerHosts = "test.test.com"/>
>> </LogObject>
>>
>> There is no log file even I  did using curl 'http://test.test.com'.
>> If I remove 'SeverHosts' tag, it is work well.
>>
>> I don't know why it's not work, plz give me some examples.
>>
>> Thanks.
>>
>>
>>
>
>

Re: 'ServerHosts' in 'logs_xml.config not work

Posted by Yongming Zhao <mi...@gmail.com>.
yeah, that is the mapped issue. you may find out one of the following two ways for your needs:
1, make use of the DNS system instead of the ip address in remap.config:

map http://test.test.com/ http://origin.test.com/

and setup your dns to resolve origin.test.com to your ip address, then you may use the ServerHosts directives in logs_xml.config file.

2, write your own LogFilters instead of ‘ServerHosts’ directive.
 
using the ‘cquuh’ to get the origin client query host.


btw, ServerHosts is a quick LogFilters on the mapped hostname.

FYI

- Yongming Zhao 赵永明

在 2014年4月11日,下午1:21,HarJin Park <ha...@gmail.com> 写道:

> Hello Zhao
> 
> My remap.config is below.
> 
> map  http://test.test.com/      http://192.168.10.100/
> reverse_map      http://192.168.10.100/      http://test.test.com/
> map  http://abc.abc.com/      http://192.168.10.200/
> reverse_map      http://192.168.10.200/      http://abc.abc.com/
> 
> 
> I'd like to separate logging abc.com and test.com
> 
> Thanks.
> 
> 
> 
> 2014-04-11 12:09 GMT+09:00 Yongming Zhao <mi...@gmail.com>:
> what is in your remap if you running a reversed proxy? the logging is based on the remapped URI, that is the server name after remap.
> 
> is that the problem?
> 
> thanks
> 
> - Yongming Zhao 赵永明
> 
> 在 2014年4月10日,下午4:55,HarJin Park <ha...@gmail.com> 写道:
> 
>> Hi
>> I'm using 4.2.0 TS, my config file is below.
>> 
>> <LogFormat>
>>  <Name = "cachelog"/>
>> ....
>> </LogFormat>
>> 
>> <LogFilter>
>>  <Name = "ERROR_UNKNOWN"/>
>>  <Condition = "crc MATCH 90"/>
>>  <Action = "REJECT"/>
>> </LogFilter>
>> 
>> <LogObject>
>>  <Format = "cachelog"/>
>>  <Filename = "test"/>
>>  <Protocols = "http"/>
>>  <ServerHosts = "test.test.com"/>
>> </LogObject>
>> 
>> There is no log file even I  did using curl 'http://test.test.com'.
>> If I remove 'SeverHosts' tag, it is work well.
>> 
>> I don't know why it's not work, plz give me some examples.
>> 
>> Thanks.
>> 
> 
> 


Re: 'ServerHosts' in 'logs_xml.config not work

Posted by HarJin Park <ha...@gmail.com>.
Hello Zhao

My remap.config is below.

map  http://test.test.com/      http://192.168.10.100/
reverse_map      http://192.168.10.100/      http://test.test.com/
map  http://abc.abc.com <http://test.test.com/>/      http://192.168.10.200/
reverse_map      http://192.168.10.200/      http://abc.abc.com/


I'd like to separate logging abc.com and test.com

Thanks.



2014-04-11 12:09 GMT+09:00 Yongming Zhao <mi...@gmail.com>:

> what is in your remap if you running a reversed proxy? the logging is
> based on the remapped URI, that is the server name after remap.
>
> is that the problem?
>
> thanks
>
> - Yongming Zhao 赵永明
>
> 在 2014年4月10日,下午4:55,HarJin Park <ha...@gmail.com> 写道:
>
> Hi
> I'm using 4.2.0 TS, my config file is below.
>
> <LogFormat>
>  <Name = "cachelog"/>
> ....
> </LogFormat>
>
> <LogFilter>
>  <Name = "ERROR_UNKNOWN"/>
>  <Condition = "crc MATCH 90"/>
>  <Action = "REJECT"/>
> </LogFilter>
>
> <LogObject>
>  <Format = "cachelog"/>
>  <Filename = "test"/>
>  <Protocols = "http"/>
>  <ServerHosts = "test.test.com"/>
> </LogObject>
>
> There is no log file even I  did using curl 'http://test.test.com'.
> If I remove 'SeverHosts' tag, it is work well.
>
> I don't know why it's not work, plz give me some examples.
>
> Thanks.
>
>
>

Re: 'ServerHosts' in 'logs_xml.config not work

Posted by Yongming Zhao <mi...@gmail.com>.
what is in your remap if you running a reversed proxy? the logging is based on the remapped URI, that is the server name after remap.

is that the problem?

thanks

- Yongming Zhao 赵永明

在 2014年4月10日,下午4:55,HarJin Park <ha...@gmail.com> 写道:

> Hi
> I'm using 4.2.0 TS, my config file is below.
> 
> <LogFormat>
>  <Name = "cachelog"/>
> ....
> </LogFormat>
> 
> <LogFilter>
>  <Name = "ERROR_UNKNOWN"/>
>  <Condition = "crc MATCH 90"/>
>  <Action = "REJECT"/>
> </LogFilter>
> 
> <LogObject>
>  <Format = "cachelog"/>
>  <Filename = "test"/>
>  <Protocols = "http"/>
>  <ServerHosts = "test.test.com"/>
> </LogObject>
> 
> There is no log file even I  did using curl 'http://test.test.com'.
> If I remove 'SeverHosts' tag, it is work well.
> 
> I don't know why it's not work, plz give me some examples.
> 
> Thanks.
>