<?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 How to generate a search that will find values which are hexadecimal only? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-will-find-values-which-are/m-p/248230#M74052</link>
    <description>&lt;P&gt;I have a query which returns a field which is occasionally a 13-digit hexadecimal value, and occasionally a string which may or may not be 13 characters long.  I'd like to create an output of just the items which match hex.&lt;/P&gt;

&lt;P&gt;There is lots written on converting hex, but I want to leave it intact for the search.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 28 Nov 2016 15:31:10 GMT</pubDate>
    <dc:creator>drinkingjimmy</dc:creator>
    <dc:date>2016-11-28T15:31:10Z</dc:date>
    <item>
      <title>How to generate a search that will find values which are hexadecimal only?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-will-find-values-which-are/m-p/248230#M74052</link>
      <description>&lt;P&gt;I have a query which returns a field which is occasionally a 13-digit hexadecimal value, and occasionally a string which may or may not be 13 characters long.  I'd like to create an output of just the items which match hex.&lt;/P&gt;

&lt;P&gt;There is lots written on converting hex, but I want to leave it intact for the search.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 15:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-will-find-values-which-are/m-p/248230#M74052</guid>
      <dc:creator>drinkingjimmy</dc:creator>
      <dc:date>2016-11-28T15:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search that will find values which are hexadecimal only?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-will-find-values-which-are/m-p/248231#M74053</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;|rex field=fieldname "(?&amp;lt;hex&amp;gt;[0-9a-fA-F]{13})"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will something like this work for you?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 15:50:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-will-find-values-which-are/m-p/248231#M74053</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2016-11-28T15:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search that will find values which are hexadecimal only?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-will-find-values-which-are/m-p/248232#M74054</link>
      <description>&lt;P&gt;I'm still getting all the values for the field.&lt;/P&gt;

&lt;P&gt;I piped this in right before my call to stats, and my tables are still full of both hex and non-hex values.:&lt;/P&gt;

&lt;P&gt;search |rex field=devicename"(?[0-9a-fA-F]{13})" | stats values(devicename) as devices by user |where mvcount(devices)&amp;gt;1&lt;/P&gt;

&lt;P&gt;I'm trying to get a list of users who have more than 1 device assigned which has a hexadecimal device name, along with the names of the hexadecimal devices.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 16:05:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-will-find-values-which-are/m-p/248232#M74054</guid>
      <dc:creator>drinkingjimmy</dc:creator>
      <dc:date>2016-11-28T16:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search that will find values which are hexadecimal only?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-will-find-values-which-are/m-p/248233#M74055</link>
      <description>&lt;P&gt;If your field is called &lt;CODE&gt;myHexField&lt;/CODE&gt; which will contain either &lt;CODE&gt;hex&lt;/CODE&gt; or &lt;CODE&gt;non-hex&lt;/CODE&gt; value can you try using &lt;CODE&gt;regex&lt;/CODE&gt; command as below:&lt;/P&gt;

&lt;P&gt;1) If your &lt;CODE&gt;hex&lt;/CODE&gt; values have a format of &lt;CODE&gt;myHexField=0xffffaaaa0000b&lt;/CODE&gt; then try this which will only filter events that have the hex values in the format &lt;CODE&gt;0xffffaaaa0000b&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourIndex sourcetype=yourSourcetype | regex  myHexField="0x[0-9a-fA-F]{13}" | complete your query
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/lKCZwY/2"&gt;See here&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;2) If your hex values do not have a leading &lt;CODE&gt;0x&lt;/CODE&gt; and appear normally as &lt;CODE&gt;myHexField=ffffaaaa0000b&lt;/CODE&gt; then try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourIndex sourcetype=yourSourcetype | regex  myHexField="[0-9a-fA-F]{13}" | complete your query
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also if there are any additional characters like &lt;CODE&gt;:&lt;/CODE&gt; in your hex value for example &lt;CODE&gt;ffff:aaaa:cccc:0&lt;/CODE&gt; then place them accordingly inside the capturing group &lt;CODE&gt;[0-9a-fA-F\:]&lt;/CODE&gt; and adjust the &lt;CODE&gt;{13}&lt;/CODE&gt; accordingly which only captures 13 values within the capturing group.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 16:17:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-will-find-values-which-are/m-p/248233#M74055</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-28T16:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search that will find values which are hexadecimal only?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-will-find-values-which-are/m-p/248234#M74056</link>
      <description>&lt;P&gt;are you trying to only bring back the hex devices? in my command, I was creating a field called hex to bring back hexadecimal values that are 13 characters long. I suppose my syntax would take any numeric, alpha, or alphanumeric value as long as it was 13 characters in length. Does the hex start with the same value or end with the same value?&lt;/P&gt;

&lt;P&gt;test the regex command here with some of the values in your devicename field:&lt;BR /&gt;
&lt;A href="https://regex101.com/"&gt;https://regex101.com/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;doc for rex command:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Rex"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Rex&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 16:24:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-will-find-values-which-are/m-p/248234#M74056</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2016-11-28T16:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search that will find values which are hexadecimal only?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-will-find-values-which-are/m-p/248235#M74057</link>
      <description>&lt;P&gt;The latter worked for me, since there is no 0x preceding the values.  Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 16:29:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-will-find-values-which-are/m-p/248235#M74057</guid>
      <dc:creator>drinkingjimmy</dc:creator>
      <dc:date>2016-11-28T16:29:25Z</dc:date>
    </item>
  </channel>
</rss>

