:doc:`CloudWatchLogs <../../logs>` / Client / get_log_fields

**************
get_log_fields
**************



.. py:method:: CloudWatchLogs.Client.get_log_fields(**kwargs)

  

  Discovers available fields for a specific data source and type. The response includes any field modifications introduced through pipelines, such as new fields or changed field types.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/GetLogFields>`_  


  **Request Syntax**
  ::

    response = client.get_log_fields(
        dataSourceName='string',
        dataSourceType='string'
    )
    
  :type dataSourceName: string
  :param dataSourceName: **[REQUIRED]** 

    The name of the data source to retrieve log fields for.

    

  
  :type dataSourceType: string
  :param dataSourceType: **[REQUIRED]** 

    The type of the data source to retrieve log fields for.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'logFields': [
              {
                  'logFieldName': 'string',
                  'logFieldType': {
                      'type': 'string',
                      'element': {'... recursive ...'},
                      'fields': {'... recursive ...'}
                  }
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **logFields** *(list) --* 

        The list of log fields for the specified data source, including field names and their data types.

        
        

        - *(dict) --* 

          Represents a log field with its name and data type information for a specific data source.

          
          

          - **logFieldName** *(string) --* 

            The name of the log field.

            
          

          - **logFieldType** *(dict) --* 

            The data type information for the log field.

            
            

            - **type** *(string) --* 

              The data type of the log field.

              
            

            - **element** *(dict) --* 

              For array or collection types, specifies the element type information.

              
            

            - **fields** *(list) --* 

              For complex types, contains the nested field definitions.

              
        
      
    
  
  **Exceptions**
  
  *   :py:class:`CloudWatchLogs.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`CloudWatchLogs.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`CloudWatchLogs.Client.exceptions.OperationAbortedException`

  
  *   :py:class:`CloudWatchLogs.Client.exceptions.ServiceUnavailableException`

  