Not able to add new indices

Hi,

I have installed X-pack and now when i am trying to add new indices, it is not happening.

when i'm checking for all the indices using the command

curl '10.1.1.150:9200/_cat/indices?v'

then i'm getting following error

{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication token for REST request [/_cat/indices?v]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","reason":"missing authentication token for REST request [/_cat/indices?v]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status":401}

Did you pass in the user and password with the curl request?

No.

are you talking about this ?

using the following command i'm able to see all the indices

curl --user rdeniro:taxidriver -XPUT '10.1.1.150:9200/_cat/indices?v'

But i have a doubt that do i need to pass the user and password while loading the data .

Yes, you do need it.

As i'm using configuration file to load the data and i'm not able to find any example related to that, where should i add user and password.

my configuration looks like this :

/usr/share/logstash/bin/logstash -f /opt/final_log.conf --path.data /opt/dir1

It would be in the Logstash file where you have configured the details to talk to Elasticsearch.

Thanks for the reply

I have added user and password in my logstash file and then tried to run it, the data gets loaded but after that also i'm not able to see my index.

my config file looks like this

input {
  file {
    path => "/opt/payment_data/queue_data*"
    start_position => "beginning"
   sincedb_path => "/dev/null"
  }
}
filter {
  csv {
      separator => ","
     columns => ["seq_num","card","type0","country","status","txnId","amount","Acquire_Id","AcqAccNo","Acquire_name","Mkey"]
  }
mutate {convert => ["txnId", "integer"]}
mutate {convert => ["amount", "integer"]}
mutate {convert => ["status", "integer"]}
}
output {
   elasticsearch {
     hosts => ["http://10.1.1.150:9200"]
     user => "elastic"
     password => "changeme"
     index => "newpayment"
  }
stdout {}
}

@warkolm is my config correct .

If yes, then why i'm not able to see my index ?

i have used an example to check whether index are being loaded or not

curl --user elastic:changeme -XPUT '10.1.1.150:9200/test?pretty' -H 'Content-Type: application/json' -d'
{
    "settings" : {
        "number_of_shards" : 1
    },
    "mappings" : {
        "type1" : {
            "properties" : {
                "field1" : { "type" : "text" }
            }
        }
    }
}
'

an index of name text can be seen in my index list.

but not with the above config file.

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