# Log server with Elasticsearch problem to index & search logfile

**URL:** https://discuss.elastic.co/t/log-server-with-elasticsearch-problem-to-index-search-logfile/11816
**Category:** Elasticsearch
**Created:** [May 5, 2013, 3:52am UTC](https://discuss.elastic.co/t/log-server-with-elasticsearch-problem-to-index-search-logfile/11816 "2013-05-05T03:52:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![David\_Barbe](https://avatars.discourse-cdn.com/v4/letter/d/e9c0ed/32.png) [@David\_Barbe](https://discuss.elastic.co/u/David_Barbe)
#### Post date: [May 5, 2013, 3:52am UTC](https://discuss.elastic.co/t/log-server-with-elasticsearch-problem-to-index-search-logfile/11816/1 "2013-05-05T03:52:57Z")

</div>

Hi,

I have log server env 280Tera, i want to index the log file.  
The files are \*.TXT file that inch them can be more than 3GB.  
I try with this command:

curl -XPUT '[http://localhost:9200/test/5](http://localhost:9200/test/5)' -d '{ "user" : "diag\_auto" ,  
"postDate" : "2013-05-01", "my\_attachment" : { "\_name" :  
"/extra/projects/upc/2013-Apr/3C\_62\_00\_60\_5B\_84/25-Apr-time-06-45-42/IPC\_00\_16\_6B\_D2\_A2\_A2\_25-Apr-time-06-50-14/pars\_log/levels.txt"}  
}  
1- this is not work

2- I want after to search text and receive back in which log this is  
displayed and also the line in the log.  
3- in the log i can have this series : "B" Line 0, "A" line 2, "C" line 5,  
"B" Line 8, "A" line 10, and "C" line 15  
i want to search the First A and only after B, C so i will have back : 1-  
"A" line 2, 2- "B" Line 8, "C" line 15

So this is help that i need.  
first how to index TXT file?  
second how do simply search on the TXT file that they are index?  
thirdly how do advanced search like i explain before?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 5, 2013, 1:31pm UTC](https://discuss.elastic.co/t/log-server-with-elasticsearch-problem-to-index-search-logfile/11816/2 "2013-05-05T13:31:38Z")

</div>

Already answered:

Hi David,

1. to use attachment plugin, you have to define a mapping first. Then encode your file in Base64, then send it to ES. Read [https://github.com/elasticsearch/elasticsearch-mapper-attachments](https://github.com/elasticsearch/elasticsearch-mapper-attachments)  
Look at the FSriver code source if you need an example. [https://github.com/dadoonet/fsriver](https://github.com/dadoonet/fsriver)

2. 

a) ok.  
b) with attachment plugin, everything will be flatten. So your lines will be indexed as "B A S C B C". Note that A is a stop word and won't be indexed.

BTW, have a look at logstash and Kibana project. It should help you here.

## HTH

David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 5 mai 2013 à 05:52, David Barbe [david@famillebarbe.com](mailto:david@famillebarbe.com) a écrit :

Hi,

I have log server env 280Tera, i want to index the log file.  
The files are \*.TXT file that inch them can be more than 3GB.  
I try with this command:

curl -XPUT '[http://localhost:9200/test/5](http://localhost:9200/test/5)' -d '{ "user" : "diag\_auto" , "postDate" : "2013-05-01", "my\_attachment" : { "\_name" : "/extra/projects/upc/2013-Apr/3C\_62\_00\_60\_5B\_84/25-Apr-time-06-45-42/IPC\_00\_16\_6B\_D2\_A2\_A2\_25-Apr-time-06-50-14/pars\_log/levels.txt"} }  
1- this is not work

2- I want after to search text and receive back in which log this is displayed and also the line in the log.  
3- in the log i can have this series : "B" Line 0, "A" line 2, "C" line 5, "B" Line 8, "A" line 10, and "C" line 15  
i want to search the First A and only after B, C so i will have back : 1- "A" line 2, 2- "B" Line 8, "C" line 15

So this is help that i need.  
first how to index TXT file?  
second how do simply search on the TXT file that they are index?  
thirdly how do advanced search like i explain before?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_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: [July 6, 2017, 2:38am UTC](https://discuss.elastic.co/t/log-server-with-elasticsearch-problem-to-index-search-logfile/11816/3 "2017-07-06T02:38:12Z")

</div>


