<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Combining Two Fields For Searching in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combining-Two-Fields-For-Searching/m-p/55775#M13620</link>
    <description>&lt;P&gt;Your eval statement is fine.  You need to fix the stats count.  This should do it.&lt;/P&gt;

&lt;P&gt;. | eval newField= query." ".q | stats count(newField)&lt;/P&gt;

&lt;P&gt;Then you could do | stats count(newField) by newField&lt;/P&gt;</description>
    <pubDate>Fri, 18 May 2012 20:34:09 GMT</pubDate>
    <dc:creator>sdaniels</dc:creator>
    <dc:date>2012-05-18T20:34:09Z</dc:date>
    <item>
      <title>Combining Two Fields For Searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-Two-Fields-For-Searching/m-p/55774#M13619</link>
      <description>&lt;P&gt;So I'm trying to run a search in Splunk and have two fields combined to return one larger field. My basic search is:&lt;/P&gt;

&lt;P&gt;(host="web01.inno-360.com" AND source="/var/log/apache2/basf_ssl_access.log" AND "/profile-services/talent") OR (host="zakta01.inno-360.com" AND basf-landscaping.inno-360.com AND "GET /search" AND query=*)&lt;/P&gt;

&lt;P&gt;From that I'm interested in two fields: 1) 'query' 2) 'q'. I would like to combine these two fields to end with something like:&lt;/P&gt;

&lt;P&gt;... | stats count by newField&lt;/P&gt;

&lt;P&gt;From searching I have tried using eval like this:&lt;/P&gt;

&lt;P&gt;... | eval newField= query." ".q | stats count by newField&lt;/P&gt;

&lt;P&gt;However I've had absolutely no luck at all with this. Any help with this would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:50:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-Two-Fields-For-Searching/m-p/55774#M13619</guid>
      <dc:creator>henryt1</dc:creator>
      <dc:date>2020-09-28T11:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Two Fields For Searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-Two-Fields-For-Searching/m-p/55775#M13620</link>
      <description>&lt;P&gt;Your eval statement is fine.  You need to fix the stats count.  This should do it.&lt;/P&gt;

&lt;P&gt;. | eval newField= query." ".q | stats count(newField)&lt;/P&gt;

&lt;P&gt;Then you could do | stats count(newField) by newField&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2012 20:34:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-Two-Fields-For-Searching/m-p/55775#M13620</guid>
      <dc:creator>sdaniels</dc:creator>
      <dc:date>2012-05-18T20:34:09Z</dc:date>
    </item>
  </channel>
</rss>

