title: Create a logStream for each log file in cloudwatchLogs
body: <p>I use <code>AWS CloudWatch</code> log agent to push my application log to AWS Cloudwatch.</p>
  
  <p>In the <code>cloudwatchLogs</code> config file inside my <code>EC2 instance</code>, I have this entry:</p>
  
  <pre><code>[/scripts/application]
  datetime_format = %Y-%m-%d %H:%M:%S
  file = /workingdir/customer/logfiles/*.log
  buffer_duration = 5000
  log_stream_name = {instance_id}
  initial_position = start_of_file
  log_group_name = /scripts/application
  </code></pre>
  
  <p>According to this configuration, all log files in workingdir directory are being sent to cloudwatchLogs in the same stream were the name is the instance Id. </p>
  
  <p>My question is, <strong>I want for each log file, create a separate <code>logStream</code>, so that the logs reading can be more fast and parseable</strong>. In other words, <strong>every time I have a new log file, a new logstream is created automatically.</strong></p>
  
  <p>I thought of doing that by a shell script in a cron job but then I'll have to change many other configurations in the architecture, so I'm looking for a way to do it in the config file. In the documentation, they say that :</p>
  
  <blockquote>
    <p>log_stream_name</p>
    
    <p>Specifies the destination log stream. You can use a literal string or
    predefined variables ({instance_id}, {hostname}, {ip_address}), or
    combination of both to define a log stream name. A log stream is
    created automatically if it doesn't already exist.</p>
  </blockquote>
  
  <p>The names of the log files can't be 100% predictible, but they always have this structure though:</p>
  
  <pre><code>CustomerName-YYYY-mm-dd.log
  </code></pre>
  
  <p>Also, another problem is that : </p>
  
  <blockquote>
    <p>A running agent must be stopped and restarted for configuration
    changes to take effect.</p>
  </blockquote>
  
  <p>How can I set the logStream in this case?</p>
  
  <p>Any ideas or suggestions or workarounds are very appreciated.</p>