title: Unable to create third index in elastic search for logging using NLog in Asp.net core
body: <p>Hello Everyone,
  I am new to the elk stack and trying to do logging using elastic search. I want to create different index for different different services in api. I am able to create two indexes of different services but can not do the same for third index.</p>
  <p>Following is my nconfig file</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
  &lt;nlog xmlns=&quot;http://www.nlog-project.org/schemas/NLog.xsd&quot;
        xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
        xsi:schemaLocation=&quot;http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd&quot;
        autoReload=&quot;true&quot;
        throwExceptions=&quot;false&quot;
        internalLogLevel=&quot;Trace&quot; internalLogFile=&quot;c:\temp1\nlog-internal.log&quot;&gt;
  
    &lt;!-- optional, add some variables
    https://github.com/nlog/NLog/wiki/Configuration-file#variables
    --&gt;
    &lt;variable name=&quot;myvar&quot; value=&quot;myvalue&quot;/&gt;
      &lt;extensions&gt;
          &lt;add assembly=&quot;NLog.Targets.ElasticSearch&quot;/&gt;
          &lt;add assembly=&quot;NLog.Web.AspNetCore&quot;/&gt;
      &lt;/extensions&gt;
  
    &lt;!--
    See https://github.com/nlog/nlog/wiki/Configuration-file
    for information on customizing logging rules and outputs.
     --&gt;
    &lt;targets&gt;
  
      &lt;!--
      add your targets here
      See https://github.com/nlog/NLog/wiki/Targets for possible targets.
      See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers.
      --&gt;
  
        &lt;target xsi:type=&quot;File&quot; name=&quot;f&quot; fileName=&quot;${basedir}/logs/log.txt&quot;
            archiveFileName=&quot;${basedir}/logs/archives/log.txt&quot;
              archiveAboveSize=&quot;5242880&quot;
              archiveEvery=&quot;Day&quot;
              archiveNumbering = &quot;Rolling&quot;
              maxArchiveFiles=&quot;3&quot;
            layout=&quot;${longdate} ${uppercase:${level}} ${message}&quot; /&gt;
  
  
  
        &lt;target xsi:type=&quot;BufferingWrapper&quot; name=&quot;ElasticSearch&quot;
        flushTimeout=&quot;5000&quot;&gt;
  
        &lt;target  xsi:type=&quot;ElasticSearch&quot; name=&quot;elastic&quot; index=&quot;aquaparallelapi&quot;
                uri=&quot;http://localhost:9200&quot;
                layout =&quot;API:aquaparallelapi|${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}&quot; /&gt;
        &lt;/target&gt;
        
        
        &lt;target xsi:type=&quot;BufferingWrapper&quot; name=&quot;ElasticSearch&quot;
        flushTimeout=&quot;5000&quot;&gt;
  
        &lt;target  xsi:type=&quot;ElasticSearch&quot; name=&quot;elastic1&quot; index=&quot;aquaparallelapiprogress&quot;
                uri=&quot;http://localhost:9200&quot;
                layout =&quot;API:aquaparallelapi|${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}&quot; /&gt;
        &lt;/target&gt;
        
         &lt;target xsi:type=&quot;BufferingWrapper&quot; name=&quot;ElasticSearch&quot;
        flushTimeout=&quot;5000&quot;&gt;
  
        &lt;target  xsi:type=&quot;ElasticSearch&quot; name=&quot;elastic2&quot; index=&quot;aquaparallelapitestcase&quot;
                uri=&quot;http://localhost:9200&quot;
                layout =&quot;API:aquaparallelapi|${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}&quot; /&gt;
        &lt;/target&gt;
  
      &lt;!--
      Write events to a file with the date in the filename.
      &lt;target xsi:type=&quot;File&quot; name=&quot;f&quot; fileName=&quot;${basedir}/logs/${shortdate}.log&quot;
              layout=&quot;${longdate} ${uppercase:${level}} ${message}&quot; /&gt;
      --&gt;
    &lt;/targets&gt;
  
    &lt;rules&gt;
      &lt;!-- add your logging rules here --&gt;
        &lt;logger enabled=&quot;true&quot; name=&quot;*&quot; minlevel=&quot;Debug&quot; writeTo=&quot;f&quot; /&gt;
      &lt;logger enabled=&quot;true&quot; name=&quot;*&quot; minlevel=&quot;Debug&quot; writeTo=&quot;elastic&quot; /&gt;
       &lt;logger enabled=&quot;true&quot; name=&quot;AquaParallelAPI.Controllers.ProgressController&quot; minlevel=&quot;Debug&quot; writeTo=&quot;elastic1&quot; /&gt;
       &lt;logger enabled=&quot;true&quot; name=&quot;AquaParallelAPI.Controllers.TestCaseController&quot; minlevel=&quot;Debug&quot; writeTo=&quot;elastic2&quot; /&gt;
      
      
    &lt;/rules&gt;
  &lt;/nlog&gt;
  </code></pre>
  <p>As you can see above indexes aquaparallelapi and aquaparallelapiprogress is created and gives the desired result but index aquaparallelapitestcase is not created. When I tried to do</p>
  <p>http://localhost:9200/aquaparallelapitestcase</p>
  <p>then</p>
  <pre><code>{&quot;error&quot;:{&quot;root_cause&quot;:[{&quot;type&quot;:&quot;index_not_found_exception&quot;,&quot;reason&quot;:&quot;no such index [aquaparallelapitestcase]&quot;,&quot;resource.type&quot;:&quot;index_or_alias&quot;,&quot;resource.id&quot;:&quot;aquaparallelapitestcase&quot;,&quot;index_uuid&quot;:&quot;_na_&quot;,&quot;index&quot;:&quot;aquaparallelapitestcase&quot;}],&quot;type&quot;:&quot;index_not_found_exception&quot;,&quot;reason&quot;:&quot;no such index [aquaparallelapitestcase]&quot;,&quot;resource.type&quot;:&quot;index_or_alias&quot;,&quot;resource.id&quot;:&quot;aquaparallelapitestcase&quot;,&quot;index_uuid&quot;:&quot;_na_&quot;,&quot;index&quot;:&quot;aquaparallelapitestcase&quot;},&quot;status&quot;:404}
  </code></pre>
  <p>Please let me know where I am wrong?</p>