<?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 convert a decimal number to binary? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-decimal-number-to-binary/m-p/263169#M78977</link>
    <description>&lt;P&gt;All, &lt;/P&gt;

&lt;P&gt;Assuming Splunk has a function for this. But for the life of me I can't find it. Is there a tool to convert decimal numbers to binary? Assuming something like this exists:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch | eval test=tobinary(mybase10number)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 24 May 2016 19:00:49 GMT</pubDate>
    <dc:creator>daniel333</dc:creator>
    <dc:date>2016-05-24T19:00:49Z</dc:date>
    <item>
      <title>How to convert a decimal number to binary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-decimal-number-to-binary/m-p/263169#M78977</link>
      <description>&lt;P&gt;All, &lt;/P&gt;

&lt;P&gt;Assuming Splunk has a function for this. But for the life of me I can't find it. Is there a tool to convert decimal numbers to binary? Assuming something like this exists:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch | eval test=tobinary(mybase10number)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 May 2016 19:00:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-decimal-number-to-binary/m-p/263169#M78977</guid>
      <dc:creator>daniel333</dc:creator>
      <dc:date>2016-05-24T19:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a decimal number to binary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-decimal-number-to-binary/m-p/263170#M78978</link>
      <description>&lt;P&gt;Hi @daniel333&lt;/P&gt;

&lt;P&gt;This answer by @javiergn on a previous question might be the solution you're looking for:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/396201/how-to-convert-ip-address-to-binary.html"&gt;https://answers.splunk.com/answers/396201/how-to-convert-ip-address-to-binary.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2016 19:06:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-decimal-number-to-binary/m-p/263170#M78978</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2016-05-24T19:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a decimal number to binary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-decimal-number-to-binary/m-p/263171#M78979</link>
      <description>&lt;P&gt;This can be done with &lt;CODE&gt;tonumber&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch | eval test=tonumber(mybase10number, 2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 May 2016 19:08:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-decimal-number-to-binary/m-p/263171#M78979</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-05-24T19:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a decimal number to binary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-decimal-number-to-binary/m-p/263172#M78980</link>
      <description>&lt;P&gt;Unfortunately tonumber(mybase10number, 2) converts binary to decimal and not the other way around.  So in the following example, the result in 'test' would be 5.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; mysearch | eval mybase2number=101 | eval test=tonumber(mybase2number, 2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Nov 2016 09:25:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-decimal-number-to-binary/m-p/263172#M78980</guid>
      <dc:creator>Jodge</dc:creator>
      <dc:date>2016-11-18T09:25:24Z</dc:date>
    </item>
  </channel>
</rss>

