<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def query_by_string(self, query, fields=None, limit=10, sampling=None):
 """ Returns raw rows that matches the given query string :arg query: query string to be run against Kibana log messages (ex. @message:"^PHP Fatal"). :type fields list[str] or None :arg limit: the number of results (defaults to 10) :type sampling int or None :arg sampling: Percentage of results to be returned (0,100) """

        query = {
            "query_string": {
                "query": query,
            }
        }

        return self._search(query, fields, limit, sampling)