title: how to parse laravel logs in fluentd
body: <p>Please help me with stackdriver logs in GCP. I'm using fluentd agent to send logs from server to GCP stackdriver logs. Main issue is that i can't split logs by levels (info, warning, error) and send in correct fromat.
  Here is my config for fluentd.</p>
  
  <pre><code>&lt;source&gt;
    @type tail
    format /^(?&lt;message&gt;(?&lt;time&gt;[^ ]*\s*[^ ]) .*)$/
    path /var/www/example.com/shared/storage/logs/laravel.*.%Y-%m-%d.log
    pos_file /var/lib/google-fluentd/pos/example-app.pos
    read_from_head true
    tag example-app
  &lt;/source&gt;
  </code></pre>
  
  <p>Right now some logs are coming to stackdriver and some are not. How to parce correctly laravel app logs to stackdriver? Thank you.</p>
  
  <p>Here is a couple examples of logs that i'm trying sent to stackdriver</p>
  
  <h1>INFO</h1>
  
  <pre><code>[2019-06-10 17:41:03] production.INFO: Updated status for  Application with external id [ 123-456-789 ]. PubSub message: array (
    'message' =&gt; 
    array (
      'attributes' =&gt; 
      array (
        'event' =&gt; 'application.applied',
        'id' =&gt; '1111-222222-5555',
        'example_id' =&gt; '1234567890',
        'source' =&gt; 'projectname',
        'timestamp' =&gt; '1560181263',
      ),
      'data' =&gt; 'sldjfhskjdfnakjfhawejflaskdflawiefjalskdfoawiejfslKDFjlkfsjgaoiwefjawoiejflKJF',
      'messageId' =&gt; '123123123',
      'message_id' =&gt; '123123123',
      'publishTime' =&gt; '2019-06-10T15:41:03.282Z',
      'publish_time' =&gt; '2019-06-10T15:41:03.282Z',
    ),
    'subscription' =&gt; 'projects/some-name/subscriptions/example-prod-application',
    '/pubsub/projectname/application/12jh3g1j2h3g12h3g1j2h3123h' =&gt; '',
  )
  </code></pre>
  
  <h1>ERROR</h1>
  
  <pre><code>[2019-06-10 17:33:05] production.ERROR: BraintreeException. account_id: 123123. 
   Declined. 
   Braintree\Result\Error[errors=, params=paymentMethod=customerId=123123, paymentMethodNonce=tokencc_bd_123123123, options=makeDefault=true, billingAddress=streetAddress=123123 E st apt 1111, locality=city, postalCode=123123, region=some-region, countryCodeAlpha2=NO, merchantId=123123123, message=Declined, verification=Braintree\Result\CreditCardVerification[status=processor_declined, cvvResponseCode=1233, avsErrorResponseCode=, avsPostalCodeResponseCode=U, =]
  </code></pre>
  
  <h1>Warning</h1>
  
  <pre><code> [2019-06-10 09:03:11] production.WARNING: projectname PubSub message validation error: Event for application with external id [ 123123123123 ] discarded because a later message was already processed. PubSub message: array (
    'message' =&gt; 
    array (
      'attributes' =&gt; 
      array (
        'event' =&gt; 'application.applied',
        'id' =&gt; '123123123',
        'projectname_id' =&gt; '123123123',
        'source' =&gt; 'some-source',
        'timestamp' =&gt; '1560150185',
      ),
      'data' =&gt; 'j1h2g3j1h2g3j1h23gj1h2g3j1h23g1j2h3g',
      'messageId' =&gt; '123123123',
      'message_id' =&gt; '123123123',
      'publishTime' =&gt; '2019-06-10T07:03:10.647Z',
      'publish_time' =&gt; '2019-06-10T07:03:10.647Z',
    ),
    'subscription' =&gt; 'projects/project-name/subscriptions/example-prod-application',
    '/pubsub/projectname/application/123123123123' =&gt; '',
  )   
  [2019-06-10 15:13:22] production.WARNING: Wrong account [ 123123123 ] provided for resetting password with token [ 123123123 ]. No password reset token found.
  </code></pre>