# How to give class name more than two class in protobuf

**URL:** <https://discuss.elastic.co/t/how-to-give-class-name-more-than-two-class-in-protobuf/133459>\
**Category:** Logstash\
**Created:** [May 28, 2018, 5:52am UTC](https://discuss.elastic.co/t/how-to-give-class-name-more-than-two-class-in-protobuf/133459 "2018-05-28T05:52:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RameshNagargoje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rameshnagargoje/32/30212_2.png) [@RameshNagargoje](https://discuss.elastic.co/u/RameshNagargoje)\
**Post date:** [May 28, 2018, 5:52am UTC](https://discuss.elastic.co/t/how-to-give-class-name-more-than-two-class-in-protobuf/133459/1 "2018-05-28T05:52:32Z")

</div>

I am having two .proto with different class names  
as person.proto  
syntax = "proto3";

message Person {

int32 id = 1;  
string name = 2;  
string email = 3;  
}

and second is message.proto

syntax = "proto3";

message SearchRequest {  
int64 query = 1;  
int64 page\_number = 2;  
string result\_per\_page = 3;  
}

these two proto compiled and generate two \_pd.rb files  
as person\_pd.rb and message\_pd.rb

and message is encoded and written in one single file using two different proto .

And here is my logstash config

input  
{  
file  
{  
path =\> "/home/ramsey/protobuf/out.bin"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"

```
codec => protobuf
{
      class_name => ["SearchRequest","Person"]
      include_path => [

                  "/home/ramsey/protobuf/message_pb.rb",
                  "/home/ramsey/protobuf/person_pb.rb"                            
                      ]
      protobuf_version => 3
}

```

}  
}

If i run logstah it gives ERROR as

codec {  
protobuf {  
# This setting must be a string  
# Expected string, got ["SearchRequest", "Person"]  
class\_name =\> ["SearchRequest", "Person"]  
...  
}  
}

Can any body figure it out.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 25, 2018, 5:52am UTC](https://discuss.elastic.co/t/how-to-give-class-name-more-than-two-class-in-protobuf/133459/2 "2018-06-25T05:52:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
