1

このリンクhttp://linuxdrops.com/log-management-using-logstash-and-kibana-on-centos-rhel-fedora/に基づいてgrokをコンパイルしようとしましたが、以下の問題が発生しました。誰かが私が遭遇した問題を解決するのを手伝ってくれることを願っています。

[root@eul2400508 grok]# make 
cc -c -pipe -fPIC -I. -O2 -I/usr/local/include -DPLATFORM_GNULinux  grok.c -o grok.o
In file included from grok.c:1:
grok.h:8:20: error: tcutil.h: No such file or directory
In file included from grok.c:1:
grok.h:39: error: expected specifier-qualifier-list before ‘TCTREE’
In file included from grok.h:132,
                 from grok.c:1:
grok_pattern.h:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
In file included from grok.h:140,
                 from grok.c:1:
grok_discover.h:9: error: expected specifier-qualifier-list before ‘TCTREE’
grok.c: In function ‘grok_init’:
grok.c:27: error: ‘grok_t’ has no member named ‘re’
grok.c:30: error: ‘grok_t’ has no member named ‘pcre_capture_vector’
grok.c:31: error: ‘grok_t’ has no member named ‘pcre_num_captures’
grok.c:32: error: ‘grok_t’ has no member named ‘max_capture_num’
grok.c:33: error: ‘grok_t’ has no member named ‘pcre_errptr’
grok.c:34: error: ‘grok_t’ has no member named ‘pcre_erroffset’
grok.c:35: error: ‘grok_t’ has no member named ‘logmask’
grok.c:36: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:39: error: ‘grok_t’ has no member named ‘patterns’
grok.c:43: error: ‘grok_t’ has no member named ‘captures_by_id’
grok.c:44: error: ‘grok_t’ has no member named ‘captures_by_name'
grok.c:45: error: ‘grok_t’ has no member named ‘captures_by_subname’
grok.c:46: error: ‘grok_t’ has no member named ‘captures_by_capture_number’
grok.c:56: error: ‘grok_t’ has no member named ‘pcre_errptr’
grok.c:57: error: ‘grok_t’ has no member named ‘pcre_erroffset’
[root@eul2400508 grok]# make 
cc -c -pipe -fPIC -I. -O2 -I/usr/local/include -DPLATFORM_GNULinux  grok.c -o grok.o
In file included from grok.c:1:
grok.h:8:20: error: tcutil.h: No such file or directory
In file included from grok.c:1:
grok.h:39: error: expected specifier-qualifier-list before ‘TCTREE’
In file included from grok.h:132,
                 from grok.c:1:
grok_pattern.h:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
In file included from grok.h:140,
                 from grok.c:1:
grok_discover.h:9: error: expected specifier-qualifier-list before ‘TCTREE’
grok.c: In function ‘grok_init’:
grok.c:27: error: ‘grok_t’ has no member named ‘re’
grok.c:30: error: ‘grok_t’ has no member named ‘pcre_capture_vector’
grok.c:31: error: ‘grok_t’ has no member named ‘pcre_num_captures’
grok.c:32: error: ‘grok_t’ has no member named ‘max_capture_num’
grok.c:33: error: ‘grok_t’ has no member named ‘pcre_errptr’
grok.c:34: error: ‘grok_t’ has no member named ‘pcre_erroffset’
grok.c:35: error: ‘grok_t’ has no member named ‘logmask’
grok.c:36: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:39: error: ‘grok_t’ has no member named ‘patterns’
grok.c:43: error: ‘grok_t’ has no member named ‘captures_by_id’
grok.c:44: error: ‘grok_t’ has no member named ‘captures_by_name'
grok.c:45: error: ‘grok_t’ has no member named ‘captures_by_subname’
grok.c:46: error: ‘grok_t’ has no member named ‘captures_by_capture_number’
grok.c:56: error: ‘grok_t’ has no member named ‘pcre_errptr’
grok.c:57: error: ‘grok_t’ has no member named ‘pcre_erroffset’
grok.c:60: error: ‘grok_t’ has no member named ‘pcre_errptr’
grok.c:62: error: ‘grok_t’ has no member named ‘pcre_erroffset’
grok.c: In function ‘grok_clone’:
grok.c:78: error: ‘grok_t’ has no member named ‘patterns’
grok.c:78: error: ‘grok_t’ has no member named ‘patterns’
grok.c:79: error: ‘grok_t’ has no member named ‘logmask’
grok.c:79: error: ‘grok_t’ has no member named ‘logmask’
grok.c:80: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:80: error: ‘grok_t’ has no member named ‘logdepth’
grok.c: In function ‘grok_pcre_callout’:
grok.c:114: error: ‘grok_t’ has no member named ‘logmask’
grok.c:114: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:119: error: ‘grok_t’ has no member named ‘logmask’
grok.c:119: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:124: error: ‘grok_t’ has no member named ‘logmask’
grok.c:124: error: ‘grok_t’ has no member named ‘logdepth’
make: *** [grok.o] Error 1
grok.c:60: error: ‘grok_t’ has no member named ‘pcre_errptr’
grok.c:62: error: ‘grok_t’ has no member named ‘pcre_erroffset’
grok.c: In function ‘grok_clone’:
grok.c:78: error: ‘grok_t’ has no member named ‘patterns’
grok.c:78: error: ‘grok_t’ has no member named ‘patterns’
grok.c:79: error: ‘grok_t’ has no member named ‘logmask’
grok.c:79: error: ‘grok_t’ has no member named ‘logmask’
grok.c:80: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:80: error: ‘grok_t’ has no member named ‘logdepth’
grok.c: In function ‘grok_pcre_callout’:
grok.c:114: error: ‘grok_t’ has no member named ‘logmask’
grok.c:114: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:119: error: ‘grok_t’ has no member named ‘logmask’
grok.c:119: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:124: error: ‘grok_t’ has no member named ‘logmask’
grok.c:124: error: ‘grok_t’ has no member named ‘logdepth’
make: *** [grok.o] Error 1
4

3 に答える 3

2

同じ問題がありましたが、debian で解決できました。

  1. すべての依存関係があることを確認する: Makefile にある - 行 269

    • バイソン
    • ctags
    • フレックス
    • gperf
    • libevent-dev
    • libpcre3-dev
    • libtokyocabinet-dev
  2. また、「wheel...@gmail.com」のコメントで見つけた指示に従いましたが、これが必要かどうかはわかりません。

Makefile は、次のように 2 つの gcc 行を変更することで修正できます。

gcc $(LDFLAGS) $^ -o $@

これに:

gcc $^ $(LDFLAGS) -o $@

そしてもちろん、正しいディレクトリを指すように CFLAGS と LDFLAGS を更新します。

于 2013-10-04T16:58:10.650 に答える
0

Ubuntu 12.04 では、上記のように ($(LDFLAGS) を $^ の後に移動して) 2 つの gcc 行を更新するmake grok必要がありましたが、これが意味することは何もする必要はなかったようです。

「正しいディレクトリを指すように CFLAGS と LDFLAGS を更新してください。」

于 2014-07-07T06:07:47.193 に答える
0

Centos では、同じパッケージについて言及する必要がありますが、名前は異なります (最後の 3 つだけ)。

bison
ctags
flex
gperf
libevent-devel
libprcre3-devel
tokyocabinet-dev
于 2014-12-16T22:41:28.843 に答える